163 |
value is 1500. They are all equivalent. You can also use a minus sign |
value is 1500. They are all equivalent. You can also use a minus sign |
164 |
to write negative floating point numbers, as in @samp{-1.0}. |
to write negative floating point numbers, as in @samp{-1.0}. |
165 |
|
|
166 |
@cindex IEEE floating point |
@cindex @acronym{IEEE} floating point |
167 |
@cindex positive infinity |
@cindex positive infinity |
168 |
@cindex negative infinity |
@cindex negative infinity |
169 |
@cindex infinity |
@cindex infinity |
170 |
@cindex NaN |
@cindex NaN |
171 |
Most modern computers support the IEEE floating point standard, which |
Most modern computers support the @acronym{IEEE} floating point standard, which |
172 |
provides for positive infinity and negative infinity as floating point |
provides for positive infinity and negative infinity as floating point |
173 |
values. It also provides for a class of values called NaN or |
values. It also provides for a class of values called NaN or |
174 |
``not-a-number''; numerical functions return such values in cases where |
``not-a-number''; numerical functions return such values in cases where |
189 |
@end table |
@end table |
190 |
|
|
191 |
In addition, the value @code{-0.0} is distinguishable from ordinary |
In addition, the value @code{-0.0} is distinguishable from ordinary |
192 |
zero in IEEE floating point (although @code{equal} and @code{=} consider |
zero in @acronym{IEEE} floating point (although @code{equal} and @code{=} consider |
193 |
them equal values). |
them equal values). |
194 |
|
|
195 |
You can use @code{logb} to extract the binary exponent of a floating |
You can use @code{logb} to extract the binary exponent of a floating |
565 |
@cindex @code{arith-error} in division |
@cindex @code{arith-error} in division |
566 |
If you divide an integer by 0, an @code{arith-error} error is signaled. |
If you divide an integer by 0, an @code{arith-error} error is signaled. |
567 |
(@xref{Errors}.) Floating point division by zero returns either |
(@xref{Errors}.) Floating point division by zero returns either |
568 |
infinity or a NaN if your machine supports IEEE floating point; |
infinity or a NaN if your machine supports @acronym{IEEE} floating point; |
569 |
otherwise, it signals an @code{arith-error} error. |
otherwise, it signals an @code{arith-error} error. |
570 |
|
|
571 |
@example |
@example |
1166 |
|
|
1167 |
If you want random numbers that don't always come out the same, execute |
If you want random numbers that don't always come out the same, execute |
1168 |
@code{(random t)}. This chooses a new seed based on the current time of |
@code{(random t)}. This chooses a new seed based on the current time of |
1169 |
day and on Emacs's process @sc{id} number. |
day and on Emacs's process @acronym{ID} number. |
1170 |
|
|
1171 |
@defun random &optional limit |
@defun random &optional limit |
1172 |
This function returns a pseudo-random integer. Repeated calls return a |
This function returns a pseudo-random integer. Repeated calls return a |
1176 |
nonnegative and less than @var{limit}. |
nonnegative and less than @var{limit}. |
1177 |
|
|
1178 |
If @var{limit} is @code{t}, it means to choose a new seed based on the |
If @var{limit} is @code{t}, it means to choose a new seed based on the |
1179 |
current time of day and on Emacs's process @sc{id} number. |
current time of day and on Emacs's process @acronym{ID} number. |
1180 |
@c "Emacs'" is incorrect usage! |
@c "Emacs'" is incorrect usage! |
1181 |
|
|
1182 |
On some machines, any integer representable in Lisp may be the result |
On some machines, any integer representable in Lisp may be the result |