We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

the smallest real number LO can handle

asked 2021-05-11 18:52:10 +0200

max2 gravatar image

updated 2021-05-11 23:15:36 +0200

Opaque gravatar image

What is the smallest rational number LO can handle ?

edit retag flag offensive close merge delete

Comments

Fixed title typo.

Opaque gravatar imageOpaque ( 2021-05-11 23:15:57 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2021-05-12 11:29:22 +0200

JohnHa gravatar image

updated 2021-05-12 12:33:22 +0200

Calc uses IEEE 754 64 bit floating point representation for all numbers, both integers and numbers with decimal points.

The smallest IEEE 754 number apart from 0 is therefore 10^-308. No number larger than 0 but smaller than 10^-308 can be represented.

The gaps between adjacent numbers are not constant: bigger numbers have bigger gaps between them.

Note also that decimals like 0.1 cannot be represented exactly - the two closest numbers to 0.1 are smaller than 0.1 and larger than 0.1. There are many anomalous results if you explore numbers at the limit of their resolution.

Search wiki with floating point IEEE for lots of information - eg see IEEE 754. There is no point in my typing what wiki explains in excruciating detail.

If the answer to your question has any relevance to you, you should not be using Calc because of its "rounding to make things look better for the average user".

edit flag offensive delete link more

Comments

No number larger than 0 but smaller than 10^-308 can be represented

As mentioned in the comments to @ajlittoz's answer, in fact the smallest representable number is much smaller than 10^-308, and is equal to 2^-1022*2^-52 (which is ~5*10^-324). It is a denormal, yes, but still. The ~2.23*10^-308 is the smallest normal number representable in IEEE 754, but repeatedly dividing it by 2 gives smaller valid (denormal) non-0 IEEE 754 numbers in Calc.

Mike Kaganski gravatar imageMike Kaganski ( 2021-05-12 18:11:59 +0200 )edit
0

answered 2021-05-11 19:16:19 +0200

ajlittoz gravatar image

The Math formula editor (you tagged your question math which targets this component) can handle any number because these are only text. Therefore, you can write any in the form you like.

It is likely that your question is erroneously tagged and you meant calc, the spreadsheet component. In this case, the answer is "the smallest number handled by your hardware". Current microprocessors provide IEEE-754. Calc uses the "double format" (64 bits).

In this format, the smallest normalized number is 1.0 × 2-1022 and the smallest unnormalized number 2-1075 (I may have made an error of 1 on the exponent).

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

edit flag offensive delete link more

Comments

Right, and how can I write 2^-1022 after = ?

max2 gravatar imagemax2 ( 2021-05-11 20:43:19 +0200 )edit
1

What is your purpose? Writing such a tiny number might make no sense mathematically or computer-ishly speaking. Do you work with Math or Calc? This is the fundamental question.

ajlittoz gravatar imageajlittoz ( 2021-05-11 20:51:19 +0200 )edit

I'm so new to LO that I do not understand the difference between math and calc. I want write base 2 negative exponent...

max2 gravatar imagemax2 ( 2021-05-11 20:56:37 +0200 )edit

Calc is a spreadsheet program for calculations and/or ordering of data

Math is a text layout program to write equations for documents.

Getting Started Guide is just one of the books available in Documentation . Cheers, Al

Earnest Al gravatar imageEarnest Al ( 2021-05-11 23:30:14 +0200 )edit
1

Right, and how can I write 2^-1022 after = ?

Let me assume Calc.

=2^-1022

As unexpected as it may seem. But I suspect that your problem is caused by "I have tried =2^-1022, and got 0, and that's why I'm asking" - again a guess from my side (see how much important information did you not include!)

This problem is not how to enter such number, but how to display it. And the answer is - scientific notation (see in number format).

In fact, the smallest value that is not 0 and is handled by LO is (as mentioned by @ajlittoz )

=2^-1022*2^-52

(since you can't use 1074 directly). But due to specifics of formatting, it will be displayed as 0.00E-307, no matter how many decimals you show. However, if you e.g. multiply such a cell by 2^1022, you would get a ...(more)

Mike Kaganski gravatar imageMike Kaganski ( 2021-05-12 08:01:12 +0200 )edit

Actually 2^-4100 gives #NUM! instead of 0.

max2 gravatar imagemax2 ( 2021-05-12 18:01:05 +0200 )edit

... which is why I wrote that you can't use 1074 as a power directly, and used a multiplication to get the smallest possible number.

But why "4100"? Where does this strange number come from?

Mike Kaganski gravatar imageMike Kaganski ( 2021-05-12 18:14:53 +0200 )edit

I've just randomly chosen something which gave me an error and from that error my question actually stems from.

max2 gravatar imagemax2 ( 2021-05-12 20:00:05 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-05-11 18:52:10 +0200

Seen: 64 times

Last updated: May 12