Document division by zero behavior
parent
ef865ffd96
commit
6bd500c34b
|
@ -15,6 +15,7 @@
|
||||||
- track individual method usages
|
- track individual method usages
|
||||||
- variable width word wrap
|
- variable width word wrap
|
||||||
- add-gadget, model-changed, set-model should compile
|
- add-gadget, model-changed, set-model should compile
|
||||||
|
- set-model set-model* and control-changed: its a hack, clean it up
|
||||||
- graphical module manager tool
|
- graphical module manager tool
|
||||||
- editor:
|
- editor:
|
||||||
- more efficient multi-line inserts
|
- more efficient multi-line inserts
|
||||||
|
@ -22,17 +23,16 @@
|
||||||
space
|
space
|
||||||
- we have trouble drawing rectangles
|
- we have trouble drawing rectangles
|
||||||
- ui browser: show currently selected vocab & words
|
- ui browser: show currently selected vocab & words
|
||||||
|
- the editor should fill up the interior of the scroller completely
|
||||||
- doc sweep
|
- doc sweep
|
||||||
- tool help
|
- tool help
|
||||||
- perhaps commands window should sort by gesture
|
- perhaps commands window should sort by gesture
|
||||||
- merge keyboard help with help in some way
|
- merge keyboard help with help in some way
|
||||||
- keyboard help: hide commands whose gestures are shadowed
|
- keyboard help: hide commands whose gestures are shadowed
|
||||||
- division by zero may not raise an error -- document this
|
|
||||||
- the editor should fill up the interior of the scroller completely
|
|
||||||
|
|
||||||
+ ui:
|
+ ui:
|
||||||
|
|
||||||
|
- help tool: edit, reload buttons
|
||||||
- words:
|
- words:
|
||||||
- S+left: reload
|
- S+left: reload
|
||||||
- S+right: inspect
|
- S+right: inspect
|
||||||
|
@ -46,7 +46,6 @@
|
||||||
- page scrolling should be timer-based too
|
- page scrolling should be timer-based too
|
||||||
- invoking interactor commands when interactor is busy -- still fucked
|
- invoking interactor commands when interactor is busy -- still fucked
|
||||||
because of grafting and ungrafting
|
because of grafting and ungrafting
|
||||||
- set-model set-model* and control-changed: its a hack, clean it up
|
|
||||||
- x11: scroll up/down wiggles caret
|
- x11: scroll up/down wiggles caret
|
||||||
- roundoff is still not quite right with tracks
|
- roundoff is still not quite right with tracks
|
||||||
- fix top level window positioning
|
- fix top level window positioning
|
||||||
|
@ -78,7 +77,8 @@
|
||||||
- horizontal wheel scrolling
|
- horizontal wheel scrolling
|
||||||
- polish OS X menu bar code
|
- polish OS X menu bar code
|
||||||
- structure editor
|
- structure editor
|
||||||
- mouse over for input:
|
- mouse over for input w/ multiple lines looks stupid
|
||||||
|
|
||||||
+ module system:
|
+ module system:
|
||||||
|
|
||||||
- convention for main entry point of a module
|
- convention for main entry point of a module
|
||||||
|
|
|
@ -17,6 +17,13 @@ ARTICLE: "number-types" "Types of numbers"
|
||||||
{ $subsection "floats" }
|
{ $subsection "floats" }
|
||||||
{ $subsection "complex-numbers" } ;
|
{ $subsection "complex-numbers" } ;
|
||||||
|
|
||||||
|
ARTICLE: "division-by-zero" "Division by zero"
|
||||||
|
"Floating point division never raises an error if the denominator is zero. This means that if at least one of the two inputs to " { $link / } ", " { $link /f } " or " { $link mod } " is a float, the result will be a floating point infinity or not a number value."
|
||||||
|
$terpri
|
||||||
|
"The behavior of integer division is hardware specific. On x86 processors, " { $link /i } " and " { $link mod } " raise an error if both inputs are integers and the denominator is zero. On PowerPC, integer division by zero yields a result of zero."
|
||||||
|
$terpri
|
||||||
|
"On the other hand, the " { $link / } " word, when given integer arguments, implements a much more expensive division algorithm which always yields an exact rational answer, and this word always tests for division by zero explicitly." ;
|
||||||
|
|
||||||
ARTICLE: "number-protocol" "Number protocol"
|
ARTICLE: "number-protocol" "Number protocol"
|
||||||
"Math operations obey certain numerical upgrade rules. If one of the inputs is a bignum and the other is a fixnum, the latter is first coerced to a bignum; if one of the inputs is a float, the other is coerced to a float."
|
"Math operations obey certain numerical upgrade rules. If one of the inputs is a bignum and the other is a fixnum, the latter is first coerced to a bignum; if one of the inputs is a float, the other is coerced to a float."
|
||||||
$terpri
|
$terpri
|
||||||
|
@ -29,7 +36,7 @@ $terpri
|
||||||
{ $subsection * }
|
{ $subsection * }
|
||||||
{ $subsection / }
|
{ $subsection / }
|
||||||
"Non-commutative operations take operands from the stack in the natural order; " { $snippet "6 2 /" } " divides 6 by 2."
|
"Non-commutative operations take operands from the stack in the natural order; " { $snippet "6 2 /" } " divides 6 by 2."
|
||||||
$terpri
|
{ $subsection "division-by-zero" }
|
||||||
"Real numbers (but not complex numbers) can be ordered:"
|
"Real numbers (but not complex numbers) can be ordered:"
|
||||||
{ $subsection < }
|
{ $subsection < }
|
||||||
{ $subsection <= }
|
{ $subsection <= }
|
||||||
|
|
|
@ -68,7 +68,7 @@ HELP: /
|
||||||
"Division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
"Division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if both inputs are integers, and the denominator is 0." } ;
|
{ $see-also "division-by-zero" } ;
|
||||||
|
|
||||||
HELP: /i
|
HELP: /i
|
||||||
{ $values { "x" "a real number" } { "y" "a real number" } { "z" "a real number" } }
|
{ $values { "x" "a real number" } { "y" "a real number" } { "z" "a real number" } }
|
||||||
|
@ -81,7 +81,7 @@ HELP: /i
|
||||||
"Integer division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
"Integer division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if both inputs are integers, and the denominator is 0." } ;
|
{ $see-also "division-by-zero" } ;
|
||||||
|
|
||||||
HELP: /f
|
HELP: /f
|
||||||
{ $values { "x" "a real number" } { "y" "a real number" } { "z" "a real number" } }
|
{ $values { "x" "a real number" } { "y" "a real number" } { "z" "a real number" } }
|
||||||
|
@ -94,7 +94,7 @@ HELP: /f
|
||||||
"Integer division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
"Integer division of ratios and complex numbers proceeds using the relevant mathematical rules."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if both inputs are integers, and the denominator is 0." } ;
|
{ $see-also "division-by-zero" } ;
|
||||||
|
|
||||||
HELP: mod
|
HELP: mod
|
||||||
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } }
|
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } }
|
||||||
|
@ -105,8 +105,7 @@ HELP: mod
|
||||||
"Modulus of bignums always yields a bignum."
|
"Modulus of bignums always yields a bignum."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if the denominator is 0." }
|
{ $see-also "division-by-zero" rem } ;
|
||||||
{ $see-also rem } ;
|
|
||||||
|
|
||||||
HELP: /mod
|
HELP: /mod
|
||||||
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } { "w" "an integer" } }
|
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } { "w" "an integer" } }
|
||||||
|
@ -117,7 +116,7 @@ HELP: /mod
|
||||||
"The quotient and remainder of two bignums is always a bignum."
|
"The quotient and remainder of two bignums is always a bignum."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if the denominator is 0." } ;
|
{ $see-also "division-by-zero" } ;
|
||||||
|
|
||||||
HELP: bitand
|
HELP: bitand
|
||||||
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } }
|
{ $values { "x" "an integer" } { "y" "an integer" } { "z" "an integer" } }
|
||||||
|
@ -225,8 +224,7 @@ HELP: rem
|
||||||
"Modulus of bignums always yields a bignum."
|
"Modulus of bignums always yields a bignum."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $errors "Throws an error if the denominator is 0." }
|
{ $see-also "division-by-zero" mod } ;
|
||||||
{ $see-also mod } ;
|
|
||||||
|
|
||||||
HELP: sgn
|
HELP: sgn
|
||||||
{ $values { "x" "a real number" } { "n" "-1, 0 or 1" } }
|
{ $values { "x" "a real number" } { "n" "-1, 0 or 1" } }
|
||||||
|
|
Loading…
Reference in New Issue