comparison 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
comparison
equal deleted inserted replaced
20623:e34692daf663 20624:7c0e10f035bd
4 ** The parser has been extended to accept, but ignore, underscore characters 4 ** The parser has been extended to accept, but ignore, underscore characters
5 in numbers. This facilitates writing more legible code by using '_' as 5 in numbers. This facilitates writing more legible code by using '_' as
6 a thousands separator or to group nibbles into bytes in hex constants. 6 a thousands separator or to group nibbles into bytes in hex constants.
7 7
8 Examples: 1_000_000 == 1e6 or 0xDE_AD_BE_EF 8 Examples: 1_000_000 == 1e6 or 0xDE_AD_BE_EF
9
10 ** The parser has been extended to understand binary numbers which begin
11 with the prefix '0b' or '0B'. The value returned is Octave's default
12 numeric class of double, not at unsigned integer class. Therefore numbers
13 greater than flintmax (2^53) will lose some precision.
14
15 Examples: 0b101 == 5 or 0B1100_0001 == 0xC1
9 16
10 ** The default colormap is now set to 'viridis' which is also 17 ** The default colormap is now set to 'viridis' which is also
11 the default colormap in matplotlib. This new colormap fixes 18 the default colormap in matplotlib. This new colormap fixes
12 some of the main issues with the old default colormap 'jet' 19 some of the main issues with the old default colormap 'jet'
13 such as its bad 'luminance profile' and is also more similar 20 such as its bad 'luminance profile' and is also more similar