Commit Graph

349 Commits (b35294eade2362dbcfcd9bd6958a08e20e35fcf1)

Author SHA1 Message Date
Doug Coleman c12b73e929 math: fix docs for binary printing. 2016-03-31 07:46:14 -07:00
Doug Coleman 30d158ccce prettyprint: Print .b .o .h with prefixes so it's not super confusing. Fixes #1351. 2016-03-30 22:59:29 -07:00
Doug Coleman c133c16377 core: Trim using lists from -tests and clean up a few irregularities. 2016-03-30 18:43:41 -07:00
John Benediktsson 4ce62e0827 math.parser: add tests for change to not throw zero division. 2016-03-30 14:31:37 -07:00
Jon Harper 0b98eb121e math.parser: number>string, don't throw zero division on '1/0' 2016-03-30 14:29:37 -07:00
Doug Coleman 20aadd5688 core: rename some double paren words. 2016-03-25 03:13:27 -07:00
John Benediktsson 6b07e6caf2 math: rename fast-gcd to simple-gcd. 2016-03-19 12:20:09 -07:00
John Benediktsson 59b41e4f90 math.parser: adding bytes>hex-string and hex-string>bytes. 2016-03-16 10:13:56 -07:00
Jon Harper 7eaa24b3e0 math.parser: simplify fix-float (from 16c93c7874) 2016-03-08 07:55:25 -08:00
Jon Harper 19fadb6c96 prettyprinter, locale independant float printing 2016-03-08 07:55:25 -08:00
John Benediktsson 141f3c9e65 math: use "i/f" for stack effect. 2015-09-30 19:01:38 -07:00
John Benediktsson e477f6996f Fix comments to be ! not #!. 2015-09-08 16:15:10 -07:00
John Benediktsson ceb75057da change ERROR: words from throw-foo back to foo. 2015-08-13 16:13:05 -07:00
Doug Coleman 02008979d9 factor: Change ERROR: foo ; to define ``throw-foo`` instead of having ``foo`` throw implicitly. The old ``foo`` still throws implicitly because this is a big change to get right in one patch, but it should be removed soon. 2015-08-12 15:26:18 -05:00
Doug Coleman 00338f62f3 factor: put inline on same line as ; for experimentation 2015-08-10 12:55:27 -05:00
John Benediktsson a8b3642c8c math.parser: make float-parse:point a fixnum. 2015-07-30 18:16:31 -07:00
John Benediktsson b3323c15bd math.parser: some inline, some fixnum+fast, some disable tests. 2015-07-30 17:59:21 -07:00
Jon Harper 8d827b2772 math.parser: support >bin and >oct for floats
This is for symmetry with "0o1p0", "0b1p0", bin> and hex> which
all already work
2015-07-30 11:04:51 -07:00
Jon Harper 4d8cb81cab math.parser: add tests/docs for floats 0b 0x bin> float> since they work 2015-07-30 11:04:51 -07:00
Jon Harper 09af182db7 math.parser, don't take infinite time to parse huge exponents 2015-07-30 11:04:51 -07:00
Jon Harper dce2ca1366 math.parser: don't lose precision in make-float-bin-exponent 2015-07-30 11:04:51 -07:00
John Benediktsson c6fad4aa61 math.ratios: moving to core. 2015-07-30 10:31:00 -07:00
Jon Harper 53efceb0ad math.integers, comment and simplify bignum/f
change the "while" that could only execute once to "when"
change the f/loop word name to "mantissa-and-guard" since it's what it
computes
change the check against 2^53 to be explicit
2015-07-26 12:33:56 -07:00
Jon Harper 5424ad5586 math.integers, bignum/f, improve performance.
This changes avoids looping many times if the denominator is a power of
2. After this change, the implementation matches the linked sbcl
algorithm.  This was probably a mistake done when porting the algorithm.
Basically, as an optimization, all trailing zeros are removed from the
base2 representation of the denominator to have smaller bignums to
divide. But the previous factor implementation didn't take this into
account when making the initial guess of the shift of the numerator to
obtain a result in the range [2^54-1,2^53]. The loop would then correct
the initial guess by a factor of 2 at each iteration, so it would run as
many iteration as the denominator base2 power reduction, instead of only
a few times. For pathological cases, the speed up is huge (10^4):
1 1000 2^ bignum/f
2015-07-26 12:33:55 -07:00
Jon Harper cc6d90a096 math.integers, fix bignum/f for results in ]0x1.0p-1022,0x0.4p-1022] 2015-07-26 12:33:55 -07:00
John Benediktsson 296974a057 math.parser: remove digits>integer. 2015-07-19 19:18:47 -07:00
John Benediktsson 16c93c7874 math.parser: simplify fix-float. 2015-07-19 17:20:37 -07:00
John Benediktsson 0dbc5e7d67 math.parser: simplify { integer ratio } >base. 2015-07-19 16:57:45 -07:00
John Benediktsson 89e3cc511e math: moving >fraction to math. 2015-07-19 16:57:45 -07:00
John Benediktsson 4cda3fe7c4 math.parser: re-use number-parse and float-parse objects. 2015-07-19 09:58:17 -07:00
Doug Coleman d2ab2e6dd1 math.parser.tests: Fix whitespace. 2015-07-17 15:19:39 -07:00
John Benediktsson c7868226d0 math.parser: simplify using member-eq?. 2015-07-16 09:55:33 -07:00
John Benediktsson 33a62c7f9d math.parser: with-radix-char quot shouldn't get called with ``f``. 2015-07-16 08:51:58 -07:00
John Benediktsson e280bafabe math.parser: remove unnecessary with-no-radix, thanks @jonenst! 2015-07-16 07:35:51 -07:00
John Benediktsson f6f596f40f math.parser: okay time for sleep, maybe this works, sorry git history. 2015-07-14 22:48:08 -07:00
John Benediktsson 5b58e1d3e8 math.parser: fix a regression. 2015-07-14 22:05:25 -07:00
John Benediktsson 94bb834eae math.parser: fix ``"-.5" dec>``. 2015-07-14 20:16:34 -07:00
John Benediktsson 866b40271d math.parser: fix "most-negative-fixnum number>string string>number fixnum?". 2015-07-14 20:03:33 -07:00
Doug Coleman 43d6f1d3e2 factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:. 2015-07-02 17:28:17 -07:00
Doug Coleman 59f3b1ea57 Revert "factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!"
Needs a bit more work.

This reverts commit 7e54cc2824.
2015-07-02 13:47:06 -07:00
Doug Coleman 7e54cc2824 factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool! 2015-07-02 11:36:08 -07:00
Doug Coleman 999aa7c897 factor: clean up spaces in -tests files 2015-07-02 10:34:01 -07:00
Doug Coleman e3cb325040 factor: clean up whitespace in -docs files 2015-07-02 10:31:22 -07:00
Doug Coleman 69ee8b9190 core, basis: Don't use the IN: foo.private feature and undocument it.
It only works well when you are loading code dynamically.
2015-06-30 08:51:07 -07:00
Björn Lindqvist ed702209ce VM: fix bignum>fixnum-strict conversion, previously most-negative-fixnum
>bignum bignum>fixnum-strict didn't work
2015-06-29 08:19:42 +02:00
Doug Coleman 44e8e7b344 primitives: Change PRIMITIVE: to check that the word is in that vocabulary and the stack effect is correct.
Use PRIMITIVE: in core/ and basis/
2015-06-25 18:02:03 -07:00
John Benediktsson 7dfe023854 math.integers: add some more tests for bit?. 2015-06-17 20:23:21 -07:00
John Benediktsson 621b50a8e5 cpu: enable bit-test intrinsic for fixnum-bit?. 2015-06-17 19:11:10 -07:00
John Benediktsson db9cfeeae2 math.integers: simplify fixnum-bit?. 2015-06-17 18:42:11 -07:00
John Benediktsson ed786070e2 math.integers: fixnum-bit? should not use fixnum-shift-fast. 2015-06-17 08:22:00 -07:00