Skip to content
Discussion options

You must be logged in to vote

This looks like a typical floating-point comparison issue. Due to potential rounding issues, it is unsafe to compare floating point variables with ==. The safe way is to compare abs(t-st_pre) < 0.1*DT or something similar. Note, the rounding errors can go both ways, hence the use of abs.

Another thought, it would be more elegant (and maybe slightly faster) if the increment of x was applied within the pre_spike_syn_code snippet (using GeNN 5.x naming here):

pre_spike_syn_code="x += 1.0;"

If done this way, there is no need for comparing t and st_pre.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@tnowotny
Comment options

Answer selected by OOOOOmoi
@OOOOOmoi
Comment options

@tnowotny
Comment options

@tnowotny
Comment options

@OOOOOmoi
Comment options

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