I was testing David Gay s most recent fixes to strtod() with different rounding modes and discovered that Apple Clang C++ (Xcode) and Microsoft Visual Studio C++ produce incorrect results for round towards zero and round down modes: their strtod()s convert numbers greater than DBL_MAX to infinity, not DBL_MAX. At first I thought Gay s strtod() was Continue reading "Numbers Greater Than DBL_MAX…
I ve encountered several NaNs over the years in the normal course of using various websites and apps. I ve only documented two of them: one in a media player, and one in a podcast app. I recently ran into another one using a loan calculator website. Rather than reporting on just that one, I decided to Continue reading "NaNs, Infinities, and Negative Numbers In Loan Calculators" The post NaNs,…
I wrote about Visual C++ incorrectly converting hexadecimal constants at the normal/subnormal double-precision floating-point boundary. It turns out that David Gay’s strtod() also has a problem with the same inputs, converting them all to 0 instead of 0x1p-1022. I have emailed Dave Gay to report the problem; I will update this post when he responds. Continue reading "Incorrect Hexadecimal to…
Martin Brown, through a referral on his Stack Overflow question, contacted me about incorrect hexadecimal to floating-point conversions he found in Visual C++, specifically conversions using strtod() at the normal/subnormal double-precision floating-point boundary. I confirmed his examples, and also found an existing problem report for the issue. It is not your typical off by one Continue reading…
I got an unsolicited email from a company offering to write AI (ChatGPT) generated articles for my site. This is the snippet they sent of their sample article: Mastering Decimal, Binary, Two s Complement Conversion In the digital world, understanding numerical notations like decimal, binary, and two’s complement can provide a substantial advantage and presents Continue reading "ChatGPT Will Never…
OK, enough just playing around with ChatGPT; let s see if it can write some code: (The line that got cut off in the screenshot of the second solution is decimal += (binaryArray[i] - '0') * Math.pow(2.0, (binaryArray.size - 1 - i).toDouble()).toInt() ) My first observation is that it was smart enough to know that by Continue reading "ChatGPT Writes Decent Code For Binary to Decimal Conversion" The…
Continuing with my recent conversation with ChatGPT I thought I d ask it if it could write haiku about binary numbers, like I have: Nice, but I was looking for the 5/7/5 syllable format (this is 6/8/5), so I asked for that specifically: Oddly, that was worse in terms of format (5/9/5). I tried again with Continue reading "Binary Numbers Haiku (by ChatGPT)" The post Binary Numbers Haiku (by…
Like everyone else these days I ve been playing around with ChatGPT: It can “write a biblical verse in the style of the King James Bible explaining how to remove a peanut butter sandwich from a VCR” but it s never heard of my site. ( Useful resource is flattering, especially after first hearing it did not know Continue reading "What ChatGPT Knows About Exploring Binary (Spoiler: Not Much)" The…
I wrote a simple byte to decimal converter app less than two months into starting to learn Jetpack Compose. Now that I have more experience with Compose in developing a real app and by participating on the #compose channel on Slack (login required) I wanted to update this demo app to reflect my Continue reading "Jetpack Compose Byte Converter App: 2022 Version" The post Jetpack Compose Byte…
IntelliJ IDEA has a code inspection for Kotlin that will warn you if a decimal floating-point literal exceeds the precision of its type (Float or Double). It will suggest an equivalent literal (one that maps to the same binary floating-point number) that has fewer digits, or has the same number of digits but is closer Continue reading "Anomalies In IntelliJ Kotlin Floating-Point Literal…
Which is bigger, 64! or 264? 64! is, because it follows from a proof by induction for any integer n greater than or equal to 4. It s also easy to just reason that 64! is bigger: 264 is 64 factors of 2, whereas 64! has 64 factors, except all but one of them (1) are Continue reading "Showing n! 2 n When n Is A Power of Two" The post Showing n! > 2 n When n Is A Power of Two first appeared on…
Do you prefer hexadecimal numbers written with uppercase letters (A-F) or lowercase letters (a-f)? For example, do you prefer the integer 3102965292 written as B8F37E2C or b8f37e2c? Do you prefer the floating-point number 126.976 written as 0x1.fbe76cp6 or 0x1.FBE76Cp6? I ran this poll on my sidebar, and after 96 responses, about 70% are prefer uppercase Continue reading "Hexadecimal Numbers:…