home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.arch      Apparently more than just beeps & boops      131,241 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 130,189 of 131,241   
   Thomas Koenig to Stephen Fuld   
   Re: Tonights Tradeoff - constants / rout   
   07 Nov 25 17:29:07   
   
   From: tkoenig@netcologne.de   
      
   Stephen Fuld  schrieb:   
   > On 11/6/2025 11:38 AM, Thomas Koenig wrote:   
      
   [...]   
      
   >> Here is the head of an output of a little script I wrote to count   
   >> all floating-point constants from My66000 assembler.  Note that   
   >> the compiler is for the version that does not yet do 0.5 etc as   
   >> floating point.  The first number is the number of occurrences,   
   >> the second one is the constant itself.   
   >>   
   >> 5-bit constants:  886   
   >> 32-bit constants: 566   
   >> 64-bit constants:597   
   >> 303 0   
   >> 290 1   
   >> 96 0.5   
   >> 81 6   
   >> 58 -1   
   >> 58 1e-14   
   >> 49 2   
   >> 46 -2   
   >> 45 -8.98846567431158e+307   
   >> 44 10   
   >> 44 255   
   >> 37 8.98846567431158e+307   
   >> 29 -0.5   
   >> 28 3   
   >> 27 90   
   >> 27 360   
   >> 26 -1e-05   
   >> 21 0.0174532925199433   
   >> 20 0.9   
   >> 18 -3   
   >> 17 180   
   >> 17 0.1   
   >> 17 0.01   
   >> [...]   
   >   
   > Interesting!  No values related to pi?  And what are the ...e+307 used for?   
      
   If you loook closely, you'll see pi/180 in that list.  But pi is   
   also there (I cut it off the list), it occurs 11 times.  And the   
   large numbers are +/- DBL_MAX*0.5, I  don't know what they are   
   used for.   
      
   By comparision, here are the values which are most frequently   
   contained in GSL:   
      
   5-bit constants:  5148   
   32-bit constants: 3769   
   64-bit constants:3140   
   2678 1   
   1518 0   
   687 -1   
   424 2   
   329 0.5   
   298 -2   
   291 2.22044604925031e-16   
   275 4.44089209850063e-16   
   273 3   
   132 -3   
   131 -0.5   
   131 3.14159265358979   
   88 4   
   86 1.34078079299426e+154   
   77 6   
   70 0.25   
   70 5   
   68 2.2250738585072e-308   
   66 10   
   64 -4   
   50 -6   
   46 0.1   
   45 5.87747175411144e-39   
   43 0.333333333333333   
   42 1e+50   
   38 6.28318530717959   
   35 9   
   31 0.2   
   30 7   
   30 -0.25   
      
   [...]   
      
   So, having values between -15.5 and +15.5 is a choice that will   
   cover quite a few floating point constants.  For different packages,   
   FP constant distributions probably vary too much to create something   
   that is much more useful.   
      
   --   
   This USENET posting was made without artificial intelligence,   
   artificial impertinence, artificial arrogance, artificial stupidity,   
   artificial flavorings or artificial colorants.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca