Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > rec.arts.sf.written > #655758 > unrolled thread
| Started by | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| First post | 2026-04-03 22:40 -0500 |
| Last post | 2026-04-06 14:40 +0000 |
| Articles | 20 — 14 participants |
Back to article view | Back to rec.arts.sf.written
xkcd: Day Counter Lynn McGuire <lynnmcguire5@gmail.com> - 2026-04-03 22:40 -0500
Re: xkcd: Day Counter Your Name <YourName@YourISP.com> - 2026-04-04 16:46 +1300
Re: xkcd: Day Counter Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-04-04 07:40 +0000
Re: xkcd: Day Counter Nioclás Pól Caileán de Ghloucester <thanks-to@Taf.com> - 2026-04-04 16:19 +0000
Re: xkcd: Day Counter Paul S Person <psperson@old.netcom.invalid> - 2026-04-04 09:16 -0700
Re: xkcd: Day Counter Stuart Redmann <DerTopper@web.de> - 2026-04-06 16:10 +0200
Re: xkcd: Day Counter Paul S Person <psperson@old.netcom.invalid> - 2026-04-06 08:33 -0700
Re: xkcd: Day Counter R Daneel Olivaw <Danni@hyperspace.vogon.gov.invalid> - 2026-04-04 10:55 +0200
Re: xkcd: Day Counter Paul S Person <psperson@old.netcom.invalid> - 2026-04-04 09:25 -0700
Re: xkcd: Day Counter Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-04-04 22:21 +0000
Re: xkcd: Day Counter Tony Nance <tnusenet17@gmail.com> - 2026-04-04 10:40 -0400
Re: xkcd: Day Counter Mark Jackson <mjackson@alumni.caltech.edu> - 2026-04-04 11:01 -0400
Re: xkcd: Day Counter Jay Morris <morrisj@epsilon3.me> - 2026-04-04 11:44 -0500
Re: xkcd: Day Counter Chris Ahlstrom <OFeem1987@teleworm.us> - 2026-04-05 10:22 -0400
Re: xkcd: Day Counter Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-05 14:13 -0700
Re: xkcd: Day Counter Thomas Koenig <tkoenig@netcologne.de> - 2026-04-06 05:25 +0000
Re: xkcd: Day Counter Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-06 00:43 -0700
Re: xkcd: Day Counter Thomas Koenig <tkoenig@netcologne.de> - 2026-04-06 20:14 +0000
Re: xkcd: Day Counter Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-06 14:30 -0700
Re: xkcd: Day Counter candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2026-04-06 14:40 +0000
| From | Lynn McGuire <lynnmcguire5@gmail.com> |
|---|---|
| Date | 2026-04-03 22:40 -0500 |
| Subject | xkcd: Day Counter |
| Message-ID | <10qq170$d49s$2@dont-email.me> |
xkcd: Day Counter
https://xkcd.com/3228/
Yes, floating point errors are the bane of my life ! Not so much now
with double precision but the single precision days were nightmares.
Explained at:
https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter
Whatever you do, do not select “Space Opera Mode” in the new mode drop
down list. "Boat mode" made me a little queasy after a while. And
"modem mode" does not seem to do anything.
Lynn
[toc] | [next] | [standalone]
| From | Your Name <YourName@YourISP.com> |
|---|---|
| Date | 2026-04-04 16:46 +1300 |
| Message-ID | <10qq1jh$dcph$1@dont-email.me> |
| In reply to | #655758 |
On 2026-04-04 03:40:15 +0000, Lynn McGuire said: > > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. > > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode†in the new mode > drop down list. "Boat mode" made me a little queasy after a while. > And "modem mode" does not seem to do anything. > > Lynn Yep. It's a problem in Excel (still today!), which is relied on by almost all businesses, thanks to the idiots at Microsoft not being able to actually program. I discovered it by accident when I had some cross-checking calucations that said there was an error, when, after quite a lot of time trying to find the error, turned out to in Excel itself. :-\ Those of us with brains use Apple computers and the Numbers spreadsheet program does not have this issue.
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2026-04-04 07:40 +0000 |
| Message-ID | <10qqf90$gkpg$1@dont-email.me> |
| In reply to | #655760 |
On Sat, 4 Apr 2026 16:46:58 +1300, Your Name wrote:
> Those of us with brains use Apple computers and the Numbers
> spreadsheet program does not have this issue.
Those of us with brains know how to use decimal or binary arithmetic
as appropriate to the problem at hand.
LibreOffice Calc:
= 0.1 + 0.1 + 0.1 - 0.3
evaluates to
0
Python, binary arithmetic:
0.1 + 0.1 + 0.1 - 0.3
evaluates to
5.551115123125783e-17
Python, decimal arithmetic:
>>> import decimal; D = decimal.Decimal
>>> D("0.1") + D("0.1") + D("0.1") - D("0.3")
evaluates to
Decimal('0.0')
[toc] | [prev] | [next] | [standalone]
| From | Nioclás Pól Caileán de Ghloucester <thanks-to@Taf.com> |
|---|---|
| Date | 2026-04-04 16:19 +0000 |
| Message-ID | <10qrdmt$18htl$2@paganini.bofh.team> |
| In reply to | #655767 |
LibreOffice Draw and LibreOffice Writer are buggy. (S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)
[toc] | [prev] | [next] | [standalone]
| From | Paul S Person <psperson@old.netcom.invalid> |
|---|---|
| Date | 2026-04-04 09:16 -0700 |
| Message-ID | <l4e2tkh3a4l2bmuqa79cq98tnhs9i70sm2@4ax.com> |
| In reply to | #655760 |
On Sat, 4 Apr 2026 16:46:58 +1300, Your Name <YourName@YourISP.com> wrote: >On 2026-04-04 03:40:15 +0000, Lynn McGuire said: >> >> xkcd: Day Counter >> https://xkcd.com/3228/ >> >> Yes, floating point errors are the bane of my life ! Not so much now >> with double precision but the single precision days were nightmares. >> >> Explained at: >> https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter >> >> Whatever you do, do not select “Space Opera Mode� in the new mode >> drop down list. "Boat mode" made me a little queasy after a while. >> And "modem mode" does not seem to do anything. >> >> Lynn > >Yep. It's a problem in Excel (still today!), which is relied on by >almost all businesses, thanks to the idiots at Microsoft not being able >to actually program. I discovered it by accident when I had some >cross-checking calucations that said there was an error, when, after >quite a lot of time trying to find the error, turned out to in Excel >itself. :-\ In OOo, use of round(<value>;2) (or equivalent function and desired precision) can help a lot. >Those of us with brains use Apple computers and the Numbers spreadsheet >program does not have this issue. -- "Here lies the Tuscan poet Aretino, Who evil spoke of everyone but God, Giving as his excuse, 'I never knew him.'"
[toc] | [prev] | [next] | [standalone]
| From | Stuart Redmann <DerTopper@web.de> |
|---|---|
| Date | 2026-04-06 16:10 +0200 |
| Message-ID | <2081810922.796969382.868060.DerTopper-web.de@news.eternal-september.org> |
| In reply to | #655760 |
Your Name <YourName@YourISP.com> wrote: > On 2026-04-04 03:40:15 +0000, Lynn McGuire said: >> >> xkcd: Day Counter >> https://xkcd.com/3228/ >> >> Yes, floating point errors are the bane of my life ! Not so much now >> with double precision but the single precision days were nightmares. >> >> Explained at: >> https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter >> >> Whatever you do, do not select âSpace Opera Modeâ in the new mode >> drop down list. "Boat mode" made me a little queasy after a while. >> And "modem mode" does not seem to do anything. >> >> Lynn > > Yep. It's a problem in Excel (still today!), which is relied on by > almost all businesses, thanks to the idiots at Microsoft not being able > to actually program. I discovered it by accident when I had some > cross-checking calucations that said there was an error, when, after > quite a lot of time trying to find the error, turned out to in Excel > itself. :-\ > > Those of us with brains use Apple computers and the Numbers spreadsheet > program does not have this issue. I encountered the following problem with Excel: if you use Excel’s Automation API (based on the Microsoft COM framework), you can access everything inside an Excel workbook programmatically. Also any charts that have been added to a spreadsheet. However, if you‘re trying to iterate through the series of the graph and try to access the formatting of the series (are there lines between the points of the series, if so which color, thickness, etc.), you‘ll get an error when you’re accessing a series that is not shown in the legend of the chart because the legend is too small. If you increase the size of the chart to an ridiculous amount (so that you can be sure that the legend will be big enough to show every series of the chart), you can access everything without a problem. If a program contains such incredible errors, I would keep my fingers from it. Although I haven’t tried to do the same thing with Open/LibreOffice‘s automation API, I‘d vouch that such an error would not occur. And yes, us professionals prefer Apple over MS, even though Visual Studio has some features that I sorely miss in other IDEs. Regards Stuart
[toc] | [prev] | [next] | [standalone]
| From | Paul S Person <psperson@old.netcom.invalid> |
|---|---|
| Date | 2026-04-06 08:33 -0700 |
| Message-ID | <bgk7tk1c7chi06sv9qh3duep15klh6c0ir@4ax.com> |
| In reply to | #655832 |
On Mon, 6 Apr 2026 16:10:08 +0200, Stuart Redmann <DerTopper@web.de> wrote: >Your Name <YourName@YourISP.com> wrote: >> On 2026-04-04 03:40:15 +0000, Lynn McGuire said: >>> >>> xkcd: Day Counter >>> https://xkcd.com/3228/ >>> >>> Yes, floating point errors are the bane of my life ! Not so much now >>> with double precision but the single precision days were nightmares. >>> >>> Explained at: >>> https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter >>> >>> Whatever you do, do not select â??Space Opera Modeâ?? in the new mode >>> drop down list. "Boat mode" made me a little queasy after a while. >>> And "modem mode" does not seem to do anything. >>> >>> Lynn >> >> Yep. It's a problem in Excel (still today!), which is relied on by >> almost all businesses, thanks to the idiots at Microsoft not being able >> to actually program. I discovered it by accident when I had some >> cross-checking calucations that said there was an error, when, after >> quite a lot of time trying to find the error, turned out to in Excel >> itself. :-\ >> >> Those of us with brains use Apple computers and the Numbers spreadsheet >> program does not have this issue. > >I encountered the following problem with Excel: if you use Excel’s >Automation API (based on the Microsoft COM framework), you can access >everything inside an Excel workbook programmatically. Also any charts that >have been added to a spreadsheet. However, if you‘re trying to iterate >through the series of the graph and try to access the formatting of the >series (are there lines between the points of the series, if so which >color, thickness, etc.), you‘ll get an error when you’re accessing a series >that is not shown in the legend of the chart because the legend is too >small. If you increase the size of the chart to an ridiculous amount (so >that you can be sure that the legend will be big enough to show every >series of the chart), you can access everything without a problem. > >If a program contains such incredible errors, I would keep my fingers from >it. Although I haven’t tried to do the same thing with Open/LibreOffice‘s >automation API, I‘d vouch that such an error would not occur. Theoretically speaking, would that allow creating a program that can convert an ODT file containing bits of spreadsheet (copied and pasted from an ODS file) to a text file that actually includes the spreasheet bits instead of ignoring them? >And yes, us professionals prefer Apple over MS, even though Visual Studio >has some features that I sorely miss in other IDEs. -- "Here lies the Tuscan poet Aretino, Who evil spoke of everyone but God, Giving as his excuse, 'I never knew him.'"
[toc] | [prev] | [next] | [standalone]
| From | R Daneel Olivaw <Danni@hyperspace.vogon.gov.invalid> |
|---|---|
| Date | 2026-04-04 10:55 +0200 |
| Message-ID | <10qqjmj$16me1$1@paganini.bofh.team> |
| In reply to | #655758 |
Lynn McGuire wrote: > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. > > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode” in the new mode drop > down list. "Boat mode" made me a little queasy after a while. And > "modem mode" does not seem to do anything. > > Lynn > The point about "modem mode" is that everything is painfully s-l-o-w. My browser (Firefox) informed me that a script was slowing my machine down (processor utilisation showed that!) and did I want to stop it? I did. Darkest Mode was amusing Space Opera Mode was a problem. Screensaver Mode was fun.
[toc] | [prev] | [next] | [standalone]
| From | Paul S Person <psperson@old.netcom.invalid> |
|---|---|
| Date | 2026-04-04 09:25 -0700 |
| Message-ID | <pee2tkdegbuuabrnencsh022fhsfl26rd1@4ax.com> |
| In reply to | #655769 |
On Sat, 4 Apr 2026 10:55:47 +0200, R Daneel Olivaw <Danni@hyperspace.vogon.gov.invalid> wrote: >Lynn McGuire wrote: >> xkcd: Day Counter >> https://xkcd.com/3228/ >> >> Yes, floating point errors are the bane of my life ! Not so much now >> with double precision but the single precision days were nightmares. >> >> Explained at: >> https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter >> >> Whatever you do, do not select “Space Opera Mode” in the new mode drop >> down list. "Boat mode" made me a little queasy after a while. And >> "modem mode" does not seem to do anything. > >The point about "modem mode" is that everything is painfully s-l-o-w. >My browser (Firefox) informed me that a script was slowing my machine >down (processor utilisation showed that!) and did I want to stop it? >I did. Here, on my Coolby Laptop, it just draws it "line by line" from top to bottom. Not really slow, and certainly not painful. In Edge. CPU usage did go from 9% to 60% (actually, it varied between 20% or so and higher values, with short peaks at 60%). But I'm not surprised. The Coolby Laptop is so much faster than the HP Envy desktop that it was purchased to provide enough functionality to keep going until a new replacement desktop computer was found that I gave up on the new desktop idea and am using the Coolby Laptop as my main computer. >Darkest Mode was amusing >Space Opera Mode was a problem. >Screensaver Mode was fun. Indeed. Stained Glass Mode and Airplane Mode were also interesting. -- "Here lies the Tuscan poet Aretino, Who evil spoke of everyone but God, Giving as his excuse, 'I never knew him.'"
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2026-04-04 22:21 +0000 |
| Message-ID | <10qs2sv$10uoq$6@dont-email.me> |
| In reply to | #655769 |
On Sat, 4 Apr 2026 10:55:47 +0200, R Daneel Olivaw wrote: > My browser (Firefox) informed me that a script was slowing my > machine down (processor utilisation showed that!) and did I want to > stop it? I did. Sounds like they were using a suboptimal way of slowing down the display, by hogging the main thread for that page or something dumb like that.
[toc] | [prev] | [next] | [standalone]
| From | Tony Nance <tnusenet17@gmail.com> |
|---|---|
| Date | 2026-04-04 10:40 -0400 |
| Message-ID | <10qr7t6$ojmo$1@dont-email.me> |
| In reply to | #655758 |
On 4/3/26 11:40 PM, Lynn McGuire wrote: > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. > > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode” in the new mode drop > down list. But if you do select Space Opera Mode, the box to change modes is active as it scrolls by. And the rollover text still works too. Tony "Boat mode" made me a little queasy after a while. And > "modem mode" does not seem to do anything. > > Lynn >
[toc] | [prev] | [next] | [standalone]
| From | Mark Jackson <mjackson@alumni.caltech.edu> |
|---|---|
| Date | 2026-04-04 11:01 -0400 |
| Message-ID | <n3cnecFs5t7U2@mid.individual.net> |
| In reply to | #655773 |
On 4/4/2026 10:40 AM, Tony Nance wrote: > On 4/3/26 11:40 PM, Lynn McGuire wrote: >> xkcd: Day Counter >> https://xkcd.com/3228/ >> >> Yes, floating point errors are the bane of my life ! Not so much now >> with double precision but the single precision days were nightmares. >> >> Explained at: >> https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter >> >> Whatever you do, do not select “Space Opera Mode” in the new mode drop >> down list. > > > But if you do select Space Opera Mode, the box to change modes is active > as it scrolls by. And if you let it get too "far away," the scrollwheel on your mouse can bring it back. Not a problem at all. -- Mark Jackson - https://mark-jackson.online/ I think it's a mistake — a very tempting mistake to make — to take stock by looking at what we still have rather than what we have already lost. - M. Gessen
[toc] | [prev] | [next] | [standalone]
| From | Jay Morris <morrisj@epsilon3.me> |
|---|---|
| Date | 2026-04-04 11:44 -0500 |
| Message-ID | <10qrf4r$r22r$1@epsilon3.eternal-september.org> |
| In reply to | #655758 |
On 4/3/2026 10:40 PM, Lynn McGuire wrote: > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. > > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode” in the new mode drop > down list. "Boat mode" made me a little queasy after a while. And > "modem mode" does not seem to do anything. > > Lynn > When I selected modem mode it made the appropriate noises and the picture slowly displayed as it downloaded.
[toc] | [prev] | [next] | [standalone]
| From | Chris Ahlstrom <OFeem1987@teleworm.us> |
|---|---|
| Date | 2026-04-05 10:22 -0400 |
| Message-ID | <10qtr82$1f4di$2@dont-email.me> |
| In reply to | #655758 |
Lynn McGuire wrote this screed in ALL-CAPS: > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. Well these days we have long double. > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode” in the new mode drop > down list. "Boat mode" made me a little queasy after a while. And > "modem mode" does not seem to do anything. Took me a little while to figure out where the mode dropdown was when in Origami mode. -- "One day I woke up and discovered that I was in love with tripe." -- Tom Anderson
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2026-04-05 14:13 -0700 |
| Message-ID | <87mrzhp0tt.fsf@example.invalid> |
| In reply to | #655811 |
Chris Ahlstrom <OFeem1987@teleworm.us> writes:
> Lynn McGuire wrote this screed in ALL-CAPS:
>
>> xkcd: Day Counter
>> https://xkcd.com/3228/
>>
>> Yes, floating point errors are the bane of my life ! Not so much now
>> with double precision but the single precision days were nightmares.
>
> Well these days we have long double.
C has had long double as a standard type since the original 1989
ANSI C standard. (K&R1, 1978, didn't have long double.)
But wider floating-point types don't eliminate rounding errors.
[...]
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | Thomas Koenig <tkoenig@netcologne.de> |
|---|---|
| Date | 2026-04-06 05:25 +0000 |
| Message-ID | <10qvg49$1t2f3$2@dont-email.me> |
| In reply to | #655818 |
Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb: > Chris Ahlstrom <OFeem1987@teleworm.us> writes: >> Lynn McGuire wrote this screed in ALL-CAPS: >> >>> xkcd: Day Counter >>> https://xkcd.com/3228/ >>> >>> Yes, floating point errors are the bane of my life ! Not so much now >>> with double precision but the single precision days were nightmares. >> >> Well these days we have long double. > > C has had long double as a standard type since the original 1989 > ANSI C standard. (K&R1, 1978, didn't have long double.) > > But wider floating-point types don't eliminate rounding errors. Nor does "long double" have to be any more accurate thean "double". C's type system leaves something to be desired in that respect. Fortran showed how it's done with its kind numbers and SELECTED_REAL_KIND function - you ask for a certain minimum precision, and the compiler either gives it to you, or your program fails at compile time. -- This USENET posting was made without artificial intelligence, artificial impertinence, artificial arrogance, artificial stupidity, artificial flavorings or artificial colorants.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2026-04-06 00:43 -0700 |
| Message-ID | <87bjfw4jq5.fsf@example.invalid> |
| In reply to | #655822 |
Thomas Koenig <tkoenig@netcologne.de> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb:
>> Chris Ahlstrom <OFeem1987@teleworm.us> writes:
>>> Lynn McGuire wrote this screed in ALL-CAPS:
>>>> xkcd: Day Counter
>>>> https://xkcd.com/3228/
>>>>
>>>> Yes, floating point errors are the bane of my life ! Not so much now
>>>> with double precision but the single precision days were nightmares.
>>>
>>> Well these days we have long double.
>>
>> C has had long double as a standard type since the original 1989
>> ANSI C standard. (K&R1, 1978, didn't have long double.)
>>
>> But wider floating-point types don't eliminate rounding errors.
>
> Nor does "long double" have to be any more accurate thean
> "double". C's type system leaves something to be desired
> in that respect.
>
> Fortran showed how it's done with its kind numbers and
> SELECTED_REAL_KIND function - you ask for a certain minimum
> precision, and the compiler either gives it to you, or your program
> fails at compile time.
You can do the same thing in C or C++ with a compile-time test.
#include <float.h>
#if LDBL_DIG < 18
#error "long double doesn't have enough precision"
#endif
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | Thomas Koenig <tkoenig@netcologne.de> |
|---|---|
| Date | 2026-04-06 20:14 +0000 |
| Message-ID | <10r147c$2c38c$1@dont-email.me> |
| In reply to | #655827 |
Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb: > Thomas Koenig <tkoenig@netcologne.de> writes: >> Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb: >>> Chris Ahlstrom <OFeem1987@teleworm.us> writes: >>>> Lynn McGuire wrote this screed in ALL-CAPS: >>>>> xkcd: Day Counter >>>>> https://xkcd.com/3228/ >>>>> >>>>> Yes, floating point errors are the bane of my life ! Not so much now >>>>> with double precision but the single precision days were nightmares. >>>> >>>> Well these days we have long double. >>> >>> C has had long double as a standard type since the original 1989 >>> ANSI C standard. (K&R1, 1978, didn't have long double.) >>> >>> But wider floating-point types don't eliminate rounding errors. >> >> Nor does "long double" have to be any more accurate thean >> "double". C's type system leaves something to be desired >> in that respect. >> >> Fortran showed how it's done with its kind numbers and >> SELECTED_REAL_KIND function - you ask for a certain minimum >> precision, and the compiler either gives it to you, or your program >> fails at compile time. > > You can do the same thing in C or C++ with a compile-time test. > >#include <float.h> > >#if LDBL_DIG < 18 >#error "long double doesn't have enough precision" >#endif Not quite the same. SELECTED_REAL_KIND gives you the _minimum_ real type for your requirements. -- This USENET posting was made without artificial intelligence, artificial impertinence, artificial arrogance, artificial stupidity, artificial flavorings or artificial colorants.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Date | 2026-04-06 14:30 -0700 |
| Message-ID | <8734174vzu.fsf@example.invalid> |
| In reply to | #655850 |
Thomas Koenig <tkoenig@netcologne.de> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb:
>> Thomas Koenig <tkoenig@netcologne.de> writes:
[...]
>>> Fortran showed how it's done with its kind numbers and
>>> SELECTED_REAL_KIND function - you ask for a certain minimum
>>> precision, and the compiler either gives it to you, or your program
>>> fails at compile time.
>>
>> You can do the same thing in C or C++ with a compile-time test.
>>
>>#include <float.h>
>>
>>#if LDBL_DIG < 18
>>#error "long double doesn't have enough precision"
>>#endif
>
> Not quite the same. SELECTED_REAL_KIND gives you the
> _minimum_ real type for your requirements.
You can do that in C or C++ too, though not as cleanly. With a
series of #if directives, you can select the minimal floating-point
type (out of float, double, long double) that satisfies some
requirement. But I don't recall ever seeing code that does this.
This is rapidly going off-topic for most of the newsgroups this is
posted to, so I won't go into more detail.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
[toc] | [prev] | [next] | [standalone]
| From | candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> |
|---|---|
| Date | 2026-04-06 14:40 +0000 |
| Message-ID | <slrn10t7h7v.gdt2.candycanearter07@candydeb.host.invalid> |
| In reply to | #655758 |
Lynn McGuire <lynnmcguire5@gmail.com> wrote at 03:40 this Saturday (GMT): > xkcd: Day Counter > https://xkcd.com/3228/ > > Yes, floating point errors are the bane of my life ! Not so much now > with double precision but the single precision days were nightmares. > > Explained at: > https://www.explainxkcd.com/wiki/index.php/3228:_Day_Counter > > Whatever you do, do not select “Space Opera Mode” in the new mode drop > down list. "Boat mode" made me a little queasy after a while. And > "modem mode" does not seem to do anything. > > Lynn I think modem mode actually slows down the transfer rate, cute idea but it freezes my browser. Boat Mode is pretty nostalgic tho, reminds me of WaveHello :) -- user <candycane> is generated from /dev/urandom
[toc] | [prev] | [standalone]
Back to top | Article view | rec.arts.sf.written
csiph-web