[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.10986426 [View]
File: 2 KB, 362x52, pyöristäminen.png [View same] [iqdb] [saucenao] [google]
10986426

Posting here so I don't get slid.

So what do you think of my rounding function? it takes values X and C and compares them to one another, and then sums them up to C+1. It returns 0 if X<C and 1 if X>C.

I have a problem with getting _.5 right as it gives a zero divisor, but otherwise it works. Could you give me a hand on it?

>> No.10986361 [View]
File: 2 KB, 362x52, pyöristäminen.png [View same] [iqdb] [saucenao] [google]
10986361

How do I stop the divisor to become a zero? Otherwise this IMO would a way to 'validate' rounding as a valid function.

Navigation
View posts[+24][+48][+96]