Register | Login
Forum Index > Requests and Feedback > Binary constants
Author Message
Pages: 1
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1475] Binary constants - posted: 2015-01-17 13:20:39
It seems there is not yet supported.
It may be done by analogy with hex constants:
Code:
const hex_const = 0xAABBCCDD;
const bin_const = 0b11111111;

Or this way: Code:
const bin_const = 10101010b;

And then may be also should add Code:
const hex_const = 0AABBCCDDh;
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1480] - posted: 2015-01-17 14:27:00
Added to my to-do list 0b11....

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1484] - posted: 2015-01-20 21:32:41
I have added 0b...., it works for numbers only at current. If you have further suggestions regarding binary usage, please let me know.

Code:
edi = 0b00000000000000000000001000000000;
print('output: ', edi, '\r\n');


output: 512

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1486] - posted: 2015-01-20 21:47:47
it works for numbers only at current
And yet what for are you planning?
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1487] - posted: 2015-01-20 21:50:39
I think it may be worth to allow binary to be used also for string constants and decimals. But I will have a fiddle with syntax to see what will work best.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 9 user(s) online. 0 member(s) and 9 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd