John Benediktsson
34aab78998
math.integers: fix docs for fixnum comparisons.
2012-09-21 10:05:33 -07:00
John Benediktsson
eaed0db99a
Revert "math: speed up integer>fixnum operations."
...
This reverts commit b467db9a9a
.
2012-09-16 07:46:22 -07:00
John Benediktsson
6ea9c0fc02
math: speed up integer>fixnum operations.
2012-09-15 08:52:06 -07:00
John Benediktsson
159f5d6344
math.integers: fix docs for >integer.
2012-09-15 08:51:19 -07:00
John Benediktsson
7e3a5fc1b2
math.order: improve docs for invert-comparison.
2012-09-14 09:45:03 -07:00
John Benediktsson
40e7813214
math.order: cleanup stack effects.
2012-09-14 09:36:09 -07:00
John Benediktsson
2a1fbb3396
math.order: make it more obvious this is a real<=>.
2012-09-14 09:19:26 -07:00
John Benediktsson
2158e772ec
math.order: speed up math comparisons using a math generic.
2012-09-14 08:43:29 -07:00
John Benediktsson
a4f264509d
math: cleaner "2/" speedup by using custom inlining.
2012-09-10 17:59:03 -07:00
John Benediktsson
36fb890be2
math: faster definition of 2/ (allows inlining of fixnum-shift-fast).
2012-09-10 17:20:31 -07:00
John Benediktsson
089bdb1268
math.integers: inline fixnum-log2.
2012-09-10 17:20:12 -07:00
John Benediktsson
009fb4249e
math: faster recip for integers and ratios.
2012-09-02 09:47:31 -07:00
John Benediktsson
18a087cb2a
math: adding some tests for bignum bitnot.
2012-08-31 15:22:20 -07:00
John Benediktsson
20100d7853
math.integers: faster fixnum-bit?.
2012-08-30 22:40:22 -07:00
Doug Coleman
cd9dd9d752
core: Throw an error when assigning a bignum to a fixnum tuple slot if the bignum doesn't fit. Fixes #594 .
2012-08-03 14:59:59 -07:00
Doug Coleman
6994b0eed8
math.integers: Bignum hashcode* -- call bignum>fixnum to avoid a dispatch.
2012-07-23 09:38:12 -07:00
Doug Coleman
fb4e3ad9bc
compiler: Fix bitand on ratios, floats. Fix shift on ratios, floats. Add integer>fixnum. Fixes #500 .
2012-07-23 09:31:12 -07:00
John Benediktsson
4e72d80256
Using "same?" in more places.
2012-07-21 10:22:44 -07:00
John Benediktsson
d1f3b326e5
math: using if-zero in more places.
2012-06-18 14:32:39 -07:00
John Benediktsson
bec49ff840
math.parser: simplify error types.
2012-06-08 07:32:01 -07:00
John Benediktsson
437b1f8785
math.parser: add some tests for errors.
2012-06-06 15:14:52 -07:00
John Benediktsson
3967b19aa5
math.parser: better error messages suggested by @erg.
2012-06-06 15:12:33 -07:00
John Benediktsson
9dbeef4933
math.parser: only allow 10 and 16 base for float>base.
2012-06-06 14:50:07 -07:00
Joe Groff
c4bd4dc1cc
math.parser: hex> etc. shouldn't take radix prefix
...
Fixes #453
2011-12-16 17:20:05 -08:00
Doug Coleman
3ba787b277
core/basis: trim down using lists
2011-11-30 23:15:42 -08:00
Joe Groff
98fc1e28bd
math.integers: make bignum/f round to even on tie
...
Fixes #372
2011-11-26 17:44:29 -08:00
Joe Groff
0f5b551790
math.integers: pass tests even if number-base set
2011-11-26 17:37:17 -08:00
Joe Groff
269fe9ea1a
math.integers: test round-to-even-on-tie behavior
2011-11-26 16:03:43 -08:00
Joe Groff
90f34d092c
math: neg? needs to be defined for all reals
2011-11-26 15:37:58 -08:00
Joe Groff
a97a9ede15
math.parser: don't accept hex float without expt
...
Part of #372
2011-11-26 15:15:46 -08:00
Joe Groff
e58afa8ab5
oops, radix prefixes shouldn't chain
2011-11-24 12:39:52 -08:00
Joe Groff
fa979425f3
math.parser: test harder
2011-11-24 12:34:50 -08:00
Joe Groff
14efcc69ab
math.parser: reject "0x" etc. without any digits
2011-11-24 12:27:40 -08:00
Joe Groff
07abeee9d9
syntax: remove BIN: HEX: OCT:
2011-11-23 20:07:33 -08:00
Joe Groff
4b6559849f
math.parser: oops
2011-11-23 19:51:15 -08:00
Joe Groff
4e8a1d0bb4
math: add neg? word
...
Do the right thing with integers or floats
2011-11-23 19:51:05 -08:00
Joe Groff
943596575a
use radix literals
2011-11-23 19:03:40 -08:00
Joe Groff
e738c7206c
math.parser: natively support 0b 0o 0x syntax
...
Closes #371
2011-11-23 18:30:22 -08:00
Joe Groff
69f35b36aa
math.parser: undo some inlining to shrink size
...
For #318 .
2011-11-11 15:49:53 -08:00
Doug Coleman
4ebe5218c7
Update Windows for word renames, fix lint errors
2011-10-24 21:50:02 -07:00
John Benediktsson
5a943b32c4
Remove stack effects from HELP: declarations.
2011-10-20 19:36:11 -07:00
John Benediktsson
6f1c44b46d
Cleanup some lint warnings.
2011-10-15 19:19:44 -07:00
John Benediktsson
312704ae68
math.parser: cleanup uses of 16/8/2 >base/base>.
2011-10-14 10:09:12 -07:00
John Benediktsson
afc07c0e05
io.binary: make le> and be> faster (20% and 75%, respectively).
...
Removed primitive byte-array>bignum and digit_stream_to_bignum from vm/.
2011-10-11 21:13:30 -07:00
Doug Coleman
82a28a082b
Remove extraneous using from math/
2011-09-25 19:32:35 -07:00
John Benediktsson
f6ee4c5a55
math.order: Removing stack effect (not quite right).
2011-09-23 17:46:49 -07:00
John Benediktsson
3c1356bf69
Adding stack effects.
2011-09-23 17:46:40 -07:00
John Benediktsson
c99e6d79cd
math: fix docs for 'when-zero'.
2011-09-02 21:13:29 -07:00
Keita Haga
3aaf58a3dd
math: fix typo in docs
2011-01-09 02:29:33 +09:00
Slava Pestov
bb4529bff2
math.integers: fix underflow and overflow behavior
2010-12-18 16:00:17 -08:00
Slava Pestov
f27080498d
Remove bignum>float VM primitive, and use bignum/f to implement >float on bignums instead, for a slight accuracy gain. Also, bignum/f now has a more efficient post-scaling algorithm to break the circular dependency on bignum>float
2010-11-24 22:41:15 -08:00
Slava Pestov
0c840a7965
math.integers: bignum/f rounding was wrong (reported by Joe Groff)
2010-11-13 16:02:12 -08:00
Slava Pestov
65dcd56b0b
math.integers: fix 0 0 bignum/f (reported by Joe Groff)
2010-11-12 19:49:18 -08:00
Slava Pestov
1985705413
compiler: now that FFI has been deconcatenatized, we no longer need the special ##unary-float-function and ##binary-float-function fastpaths
2010-08-13 23:59:19 -07:00
Joe Groff
1196087991
math: declare quotation stack effects on each-integer, times, find-integer, all-integers?
2010-05-13 14:30:19 -07:00
Doug Coleman
23b3535053
Fix typo in between? stack effect docs
2010-05-05 18:16:54 -05:00
Slava Pestov
288090d993
math.parser: expose a format-float primitive for use by formatting vocabulary
2010-04-13 21:21:28 -07:00
Joe Groff
18f3df9d4a
more help-lint
2010-03-09 21:02:43 -08:00
Joe Groff
85f30987e2
spray some polymorphic stack effects on kernel, math, and sequences
2010-03-05 00:21:10 -08:00
Doug Coleman
949f658928
Fix a couple of typos in complex number docs
2010-02-22 17:39:30 -06:00
Philipp Brüschweiler
db663548f9
math: typo in rem docs
2010-02-19 11:23:20 +01:00
Slava Pestov
1c9a95122a
math.integers: remove a -rot usage
2010-02-10 15:44:49 +13:00
Joe Groff
0f651c8506
math.parser: support leading + on significand and exponent so string>number can be a proper superset of C strto* functions
2010-02-07 14:21:59 -08:00
Joe Groff
ce1ff01851
math.parser: add unit tests to ensure that "1e2" parses as 100.0 in decimal and as integer 1E2 in bases >= 15 (it does now)
2010-02-07 13:09:59 -08:00
Joe Groff
90ea5796f4
math.parser: fix digit> bug found by Blei
2010-02-07 13:04:20 -08:00
Slava Pestov
4e766a0a12
math.parser: clean up and merge new-math-parser branch
2010-02-08 01:39:18 +13:00
Slava Pestov
afee6ccfcd
Merge branch 'new-math-parser' of git://factorcode.org/git/factor into new-math-parser
2010-02-07 23:28:18 +13:00
Slava Pestov
5ed0bc72aa
Merge git://github.com/littledan/Factor into littledan
2010-01-31 02:54:58 +13:00
Slava Pestov
e45816cf9b
math: docs fix
2010-01-30 21:14:41 +13:00
Daniel Ehrenberg
52f2ac2bb9
Tests for propagation additions; making fixnum-bit? inline
2010-01-25 20:15:17 -06:00
Daniel Ehrenberg
d3590ea210
Merge branch 'master' of git://factorcode.org/git/factor
...
Conflicts:
basis/compiler/tree/propagation/transforms/transforms.factor
2010-01-20 00:15:55 -06:00
Daniel Ehrenberg
aa1651032d
Adding compiler transforms in propagation
2010-01-20 00:10:49 -06:00
Slava Pestov
7f7e1e4e1d
Help lint fixes for iota
2010-01-15 17:04:14 +13:00
Slava Pestov
4cce9259e1
math.parser: fix docs -- maximum radix is 16 not 36
2010-01-15 08:36:40 +13:00
Doug Coleman
4c71d71907
random is generic now -- iota random -> random
2010-01-14 12:48:57 -06:00
Slava Pestov
df4fb4a3ee
Removing integers-as-sequences
2010-01-15 07:15:33 +13:00
Slava Pestov
47a5e96547
Rework min and max so that behavior with floats and NaNs is consistent between generic arithmetic and open-coded float intrinsics
2010-01-13 22:20:16 +13:00
Slava Pestov
0612bc6177
Factor source files should not be executable
2009-11-21 17:50:43 -06:00
Slava Pestov
a46671e3ad
math.integers: fix help lint on 32-bit
2009-11-06 04:52:52 -06:00
Slava Pestov
a089163a40
math: fix test failures on 32-bit
2009-11-06 04:50:41 -06:00
Joe Groff
61a3e4e814
new, faster one-pass number parser
2009-11-01 01:59:12 -05:00
Joe Groff
60aecace7d
remove dangling PRIVATE> from math.parser
2009-11-01 00:42:25 -05:00
Joe Groff
d4a207662e
might want to accurately divide large negative fixnums too
2009-10-31 12:10:29 -05:00
Joe Groff
a7011fe087
use bignum/f to get accurate division of fixnums >= 2^53 on 64-bit platforms
2009-10-31 12:06:56 -05:00
Joe Groff
70ffa003ec
eliminate roll/-roll from core
2009-10-30 13:36:15 -05:00
Doug Coleman
1476cdb974
reverse-here -> reverse!
2009-10-28 14:40:15 -05:00
Joe Groff
ad18098a4f
add some math.parser hints that slightly improve number parsing performance
2009-10-26 17:48:05 -05:00
Joe Groff
28f5347e71
tighten some screws in math.parser
2009-10-22 20:48:46 -05:00
Joe Groff
943bde59f9
speed up dec>float a little
2009-10-22 18:55:32 -05:00
Joe Groff
1a7b4d7c63
inline the trivial words in math.parser
2009-10-22 17:26:22 -05:00
Keith Lazuka
405e5d015b
docs: change $subsection to $subsections
2009-10-02 12:15:48 -04:00
Slava Pestov
0836e79e66
Fix conflict
2009-09-23 20:52:04 -05:00
Slava Pestov
e1efb189a4
math and math.vectors: improved documentation
2009-09-23 03:08:45 -05:00
Keith Lazuka
bea4aa7662
docs: updated some docs to use new markup
2009-09-22 15:22:34 -04:00
Joe Groff
f459c24e45
oops, float>hex didn't preserve leading zeroes in mantissa
2009-09-20 16:48:42 -05:00
Joe Groff
238f600da2
document number-base prettyprinter variable. add more docs about hex float syntax
2009-09-18 15:11:01 -05:00
Joe Groff
8c14af3f6c
add a number-base configuration variable to prettyprint.config. set to 2 to print BIN:, 8 to print OCT:, 10 to print decimal, 16 to print HEX:
2009-09-14 15:03:05 -05:00
Slava Pestov
32b95c2cdf
math: add unordered comparison operators u< u<= u> u>= which behave exactly like < <= > >= except no floating point exceptions are set if one or both inputs are NaNs; also add efficient intrinsic for unordered? predicate, and fix propagation type functions for abs, absq, and bitnot
2009-09-12 22:20:13 -05:00
Slava Pestov
f890f39d7c
math.parser: fix example
2009-09-12 21:45:57 -05:00
Slava Pestov
aad68418d2
math, syntax: document hexadecimal float literal syntax
2009-09-12 21:18:17 -05:00
Slava Pestov
018677319c
math, syntax: fix help lint
2009-09-12 21:07:31 -04:00
Slava Pestov
1337f82ce6
math.order: better docs
2009-09-12 16:33:42 -05:00
Slava Pestov
11f984e734
math.floats: fix abs on floats; -0.0 abs should be 0.0 not -0.0
2009-09-12 16:24:07 -05:00
Slava Pestov
3c55e7fe0c
Add NAN: literal syntax for NANs with a payload
2009-09-12 15:06:15 -05:00
Joe Groff
0ed5822ed9
HEX: X.XXXpEEE hexadecimal float literal syntax
2009-09-11 20:11:29 -05:00
Joe Groff
14f412b404
add an "unordered?" predicate to math, with a dumb implementation for now
2009-09-10 23:45:18 -04:00
Joe Groff
1bc97b4624
add unit tests for comparisons against nan
2009-09-03 17:27:06 -05:00
Joe Groff
1106fb10f1
let's not forget about hex literals
2009-09-01 21:28:23 -05:00
Joe Groff
1a04bc1124
require numeric literals to begin and end with a digit/decimal point so that stuff like "," and "1," don't parse as numbers
2009-09-01 21:14:26 -05:00
Slava Pestov
ec70e1d714
More minor documentation tweaks
2009-08-30 06:32:20 -05:00
Slava Pestov
2bb6293217
compiler: add fixnum-min/max intrinsics; ~10% speedup on benchmark.yuv-to-rgb
2009-08-28 19:02:59 -05:00
Slava Pestov
d957ae4e44
Performance improvements to make struct-arrays benchmark faster
...
- improved optimization of ##unbox-any-c-ptr on ##box-displaced-alien; convert it to ##unbox-c-ptr where possible using class info stored in the ##bda instruction
- make fcos, fsin, etc inline again; everything in math.libm inline again, except for fsqrt which is an intrinsic
- convert min and max on floats to float-min and float-max
- make min and max not inline, so that the above can work
- struct-arrays: rice a bit so that more fixnums come up
2009-08-28 05:21:16 -05:00
Slava Pestov
79cdc45339
math: move float methods to math.floats
2009-08-20 03:55:19 -05:00
Joe Groff
15a7148de0
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-19 15:48:07 -05:00
Daniel Ehrenberg
8120bdebea
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-18 00:02:29 -05:00
Daniel Ehrenberg
62cd1d280c
Fixing docs typo in math.floats
2009-08-18 00:02:19 -05:00
Slava Pestov
030b1b816c
Add inline declarations for various assorted methods
2009-08-17 22:32:21 -05:00
Joe Groff
24d9a8635c
Merge branch 'struct-classes' of git://factorcode.org/git/factor
2009-08-17 21:26:19 -05:00
Doug Coleman
7c92ab1ea5
move if-zero etc to math, remove 1-/1+ from math
2009-08-14 14:27:23 -05:00
Joe Groff
6fe7fe72c7
Merge branch 'master' of git://factorcode.org/git/factor
2009-08-14 10:55:05 -04:00
Doug Coleman
686b3e348e
use ERROR: in several places instead of throwing strings
2009-08-11 23:09:02 -05:00
Doug Coleman
15ae8fb673
fix sgn docs
2009-08-11 18:15:24 -05:00
Doug Coleman
14ef1649d4
add if-zero/when-zero/unless-zero to core/ and update usages
2009-08-11 17:59:40 -05:00
Brad Christensen
f8405e9c55
A number of documentation fixes.
...
* Short-circuit combinators now show correct stack effect for quots
* Groups and Clumps unchecked examples corrected, made runnable in listener
* Class operations had duplicate link to class-types
* Protocol slots readability fixed
* Tuple word property for "tuple-layout" corrected to "layout"
* cond>quot sentence started in lowercase
* Method precedence code example missing stack effect for GENERIC:, M: integer explain changed to detail an integer
* Motivation for default streams readability
* Default input and output streams duplicate readln link removed from output stream words section
* Looping combinators do description clarified
* Make philosophy missing space
* Linear order protocol duplicate after? link removed
* Parsing words readability fix
* Copied note regarding with-compilation-unit from define to define-declared and define-inline
2009-08-10 23:34:25 -07:00
Joe Groff
0376cf0f9d
allow commas in numeric literals
2009-08-10 19:33:27 -04:00
Joe Groff
f034be3c9e
nitpick
2009-07-24 21:04:49 -05:00
Doug Coleman
01a0bf7c36
add more links to floating point words in docs
2009-07-24 18:11:51 -05:00
Slava Pestov
4ee1f68e30
Documentation fixes
2009-07-18 06:32:57 -05:00
Doug Coleman
a54c78007b
add a clamp word to math.order, use clamp word throughout libraries
2009-05-24 21:35:50 -05:00
Joe Groff
c5d440700d
0.0 neg ought to be -0.0
2009-05-21 18:49:22 -05:00
Joe Groff
7584b30755
"math" help-lint
2009-05-09 20:23:56 -05:00
Slava Pestov
4ee4357e75
Fix negative zero smashing with bootstrap
2009-05-09 18:17:30 -05:00
Joe Groff
9021062795
fp-nan? was defined incorrectly. while i'm here, let's add some more float manipulation words
2009-05-09 09:49:31 -05:00
Slava Pestov
8e3e67fad4
Fix test failures
2009-05-04 13:10:56 -05:00
Slava Pestov
b4088373b7
Merge branch 'master' of git://factorcode.org/git/factor
2009-05-04 05:16:47 -05:00
Slava Pestov
a63ad6a7a5
Remove cruddy string encoding/decoding code from VM
2009-05-02 13:45:38 -05:00
Doug Coleman
0ad6d1fb7b
add a few usages of iota, remove most 1+ and 1- from core
2009-05-01 19:58:24 -05:00
Slava Pestov
fc4894fbdf
Replace ratio and complex built-in types with tuples defined in the library. This frees up two lo-tags, so move array and quotation over to these tags and update compiler for new tags
2009-04-30 00:27:35 -05:00
Slava Pestov
1c68b389cc
Document special float values
2009-04-14 15:05:10 -05:00
Slava Pestov
cb6f59ff5b
Fix unit test failure in math.parser
2009-04-13 20:25:55 -05:00
Slava Pestov
0ffd43e2e3
1.0/0.0 => 1/0.
2009-04-13 19:48:08 -05:00
Slava Pestov
0fda643ab1
Optimizing string>number
2009-04-11 20:30:51 -05:00
Slava Pestov
99b8400e56
Documentation updates
2009-04-06 03:00:46 -05:00
Slava Pestov
8385e9d9f5
Fixing compile errors, test failures and help lint failures
2009-03-23 17:12:41 -05:00
Slava Pestov
25a877e50b
Merge OneEyed's patch
2009-02-28 17:06:55 -06:00
Slava Pestov
cd53c2bd37
produce and produce-as: don't need third quotation either
2009-02-28 15:31:34 -06:00
Slava Pestov
78ce670101
Merge branch 'for-slava' of git://git.rfc1149.net/factor
2009-02-28 14:42:56 -06:00
Slava Pestov
45dae72f4a
Merge branch 'master' into new_ui
2009-02-26 23:31:36 -06:00
Doug Coleman
a083832ab4
fix typo in math docs
2009-02-26 18:10:11 -06:00
Slava Pestov
91d0c4ed1f
Fix conflict
2009-02-22 20:02:13 -06:00