There is a number N for exemple. If this number is <= 75 it is multiplied by 2.60. If it's >75 but <=220 it's multiplied by 2.20. If it's >220 it's multiplied by 1.45.

Is there any possibility to write this program with IF?

Sure, some IfElse statements would be handy here

```
If N<=75:Then
N*2.6->N
Else
If N<=220:Then
N*2.2->N
Else
N*1.45-.N
End
End
```

hmmm.. would this work?

`(N<=75)*2.6 + (N>75 and N<=220)*2.2 + (N>220)*1.45→N`

EDIT: oops. i just saw the if part

Visit Calccrypto for info on crypto

KC2ZOF

Of course, you could use logic and boolean to cut down size.

(2.6N)(N<=75)+(2.2N)(N<=220)+(1.45N->N

The first response is 49 bytes in size.

This optomized version is 35 bytes.

However, after doing a quick test I'm not sure this would be faster, which goes against everything I know.

(Post sniped. There appears to be multiple ways then this could be logically done.)

I am getting errors for certain numbers with this.

Run N=340

`sum(N>{75,220` returns 2

`N/40(104-7Ans ^{2}-Ans` returns 629

Since 340 is above 220, multiply it by 1.45 to get 493. Answers don't match.

The idea is fascinating though, and I would have never thought of it. Using the same concept, I used quadratic regression and somehow ended up with nice numbers:

sum(N>{75,220

N(2.6-.175Ans^{2}-.225Ans

or

sum(N>{75,220:N(2.6-.175Ans^{2}-.225Ans

This returns 493 in a total of 29 bytes. This method would be useful in perhaps many other applications.

Timothy Foster - @tfAuroratide

Auroratide.com - Go here if you're nerdy like me

Thanks builderboy, that works. I don't know why but yesterday when I tried to do it with Else If i didin't work.

No problem. Was there any specific reason for wanting to use If and not booleans or any other the tricky solutions brought around?