ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1043. Cover an Arc

conversion float to int
Posted by anus (USU) 23 Jul 2006 03:12
When I solved this problem then understood that I don't know how humanly round down float to int in C++, because int(double) round down positive numbers but round up negative.
Now I use int(x+1000000000)-1000000000, but it is bad.
Any ideas ...
Re: conversion float to int
Posted by it4.kp 23 Jul 2006 05:40
why don't you use floor() function?
Re: conversion float to int
Posted by anus (USU) 23 Jul 2006 12:46
Good idea. It is possible to use int(floor()).
Nowhere could find proper function. Thnks.