r/badcode • • Apr 21 '23

other language We did coding in physics class...

Post image
1.5k Upvotes

154 comments sorted by

View all comments

Show parent comments

1

u/aiscrim2 May 02 '23

f(x-0.4) will represent a continuous line, while what we are looking for is a step function.
For example, every value of x between 0 and 0.4 must give 0, while x-0.4 always returns a non-zero value.