Skip to content

Commit

Permalink
Update main.c (#36)
Browse files Browse the repository at this point in the history
Cast on end operation to solve float operation problems in some systems.
  • Loading branch information
ernesto-xload authored and fulldecent committed Aug 7, 2017
1 parent 8cce5ef commit 32d4d16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Using _mm_stream_si128/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static inline void square_am_signal(float time, float frequency) {
uint64_t period = NSEC_PER_SEC / frequency;

uint64_t start = mach_absolute_time();
uint64_t end = start + time * NSEC_PER_SEC;
uint64_t end = start + (uint64_t)(time * NSEC_PER_SEC);

while (mach_absolute_time() < end) {
uint64_t mid = start + period / 2;
Expand Down

0 comments on commit 32d4d16

Please sign in to comment.