diff NEWS @ 20624:7c0e10f035bd

Extend parser to accept binary constants that begin with '0b' or '0B'. * NEWS: Announce change: * lex.ll: Define NUMBIN to be 0[bB] followed by 0,1, or '_'. Define NUMBER to be NUMREAL|NUMHEX|NUMBIN. *lex.ll (looks_like_bin): New function to detect 0[bB] prefix. *lex.ll (handle_numbe): Call looks_like_bin() and if found then convert binary string to double. * parser.tst: Add tests for new behavior.
author Rik <rik@octave.org>
date Fri, 09 Oct 2015 18:52:58 -0700
parents e34692daf663
children
line wrap: on
line diff
--- a/NEWS	Mon Oct 05 14:05:58 2015 -0700
+++ b/NEWS	Fri Oct 09 18:52:58 2015 -0700
@@ -7,6 +7,13 @@
 
     Examples: 1_000_000 == 1e6 or 0xDE_AD_BE_EF
 
+ ** The parser has been extended to understand binary numbers which begin
+    with the prefix '0b' or '0B'.  The value returned is Octave's default
+    numeric class of double, not at unsigned integer class.  Therefore numbers
+    greater than flintmax (2^53) will lose some precision.
+
+    Examples: 0b101 == 5 or 0B1100_0001 == 0xC1
+
  ** The default colormap is now set to 'viridis' which is also
     the default colormap in matplotlib. This new colormap fixes
     some of the main issues with the old default colormap 'jet'