Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating point inaccuracies #29

Open
TheChymera opened this issue Jul 30, 2018 · 0 comments
Open

Floating point inaccuracies #29

TheChymera opened this issue Jul 30, 2018 · 0 comments

Comments

@TheChymera
Copy link
Member

TheChymera commented Jul 30, 2018

An onset time of 810.0 s (.tsv file below)

onset	duration	frequency	pulse_width	amplitude	out_channel	wavelength	strength	strength_unit
160.0	20.0	15.0	0.005	1.0	1.0	488.0	30.0	mW
290.0	20.0	15.0	0.01	1.0	1.0	488.0	30.0	mW
420.0	20.0	25.0	0.005	1.0	1.0	488.0	30.0	mW
550.0	20.0	25.0	0.01	1.0	1.0	488.0	30.0	mW
680.0	20.0	15.0	0.005	1.0	1.0	488.0	30.0	mW
810.0	20.0	15.0	0.01	1.0	1.0	488.0	30.0	mW
940.0	20.0	25.0	0.005	1.0	1.0	488.0	30.0	mW
1070.0	20.0	25.0	0.01	1.0	1.0	488.0	30.0	mW
1200.0	20.0	15.0	0.005	1.0	1.0	488.0	30.0	mW
1330.0	20.0	15.0	0.01	1.0	1.0	488.0	30.0	mW
1460.0	20.0	25.0	0.005	1.0	1.0	488.0	30.0	mW
1590.0	20.0	25.0	0.01	1.0	1.0	488.0	30.0	mW

is represented by COSplay as 809.9999:

Searching port...
Connection to /dev/ttyACM1 established.

Sequences found on computer:
None
Size of sequence library: 1

Current sequence:
onset   duration        frequency       pulse_width     amplitude       out_channel     wavelength      strength        strength_unit
160.0   20.0    15.0    0.005   1.0     1.0     488.0   30.0    mW
290.0   20.0    25.0    0.005   1.0     1.0     488.0   30.0    mW
420.0   20.0    15.0    0.01    1.0     1.0     488.0   30.0    mW
550.0   20.0    25.0    0.01    1.0     1.0     488.0   30.0    mW
680.0   20.0    15.0    0.005   1.0     1.0     488.0   30.0    mW
809.9999        20.0    25.0    0.005   1.0     1.0     488.0   30.0    mW
940.0   20.0    15.0    0.01    1.0     1.0     488.0   30.0    mW
1070.0  20.0    25.0    0.01    1.0     1.0     488.0   30.0    mW
1200.0  20.0    15.0    0.005   1.0     1.0     488.0   30.0    mW
1330.0  20.0    25.0    0.005   1.0     1.0     488.0   30.0    mW
1460.0  20.0    15.0    0.01    1.0     1.0     488.0   30.0    mW
1590.0  20.0    25.0    0.01    1.0     1.0     488.0   30.0    mW

I assume this is because there is no precise 810.0 s floating point, and at any rate this is not mitigated by passing 810 time (without the decimal point). Still, to avoid errors in record keeping, ideally COSplay should record the instructions it receives and it executes. If there is no way to distinguish 809.9999 from 810.0 that means it's just as correct to record 810.0.
@faymanns thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant