Тотальная неудачница и убийца жёстких дисков.
#post-id: 7988-18-51
#original-date: 9.06.2022 Thu
#original-time: 6:51 PM
#original-day: 7988
#original-host: Win7 Ultimate SP1 (Build 7601)
Невероятные приключения VB6 программ в мире округления.
#upd(9.06.2022 - 6:56 PM):
Чё за хуйня?
#upd(9.06.2022 - 6:59 PM):
Нашлось в справке по VB5.
When the fractional part is exactly 0.5, CInt and CLng always round it to the nearest even number. For example, 0.5 rounds to 0, and 1.5 rounds to 2. CInt and CLng differ from the Fix and Int functions, which truncate, rather than round, the fractional part of a number. Also, Fix and Int always return a value of the same type as is passed in.
Это не про Round(), но всё же.
Both Int and Fix remove the fractional part of number and return the resulting integer value.
The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
Звучит как что-то из далёкого прошлого OO Уже сто лет не пользовалась этими функциями...
#upd(9.06.2022 - 7:42 PM):
Округление до ближайшего чётного (в английском языке известно под названием англ. banker's rounding — «округление банкира») — округление для этого случая происходит к ближайшему чётному числу, то есть 2,5 – 2; 3,5 – 4.
https://ru.wikipedia.org/wiki/Округление
Пишут, что Round() именно так и работает. Вот засада!
#upd(9.06.2022 - 8:49 PM):
Придётся пилить ручками человеческое округление. А мне всего-то нужен был аналог Ceil(), который я пилила как «Round(X + 0.5)», но не сразу поняла, что оно как-то странно работает.
#original-date: 9.06.2022 Thu
#original-time: 6:51 PM
#original-day: 7988
#original-host: Win7 Ultimate SP1 (Build 7601)
Невероятные приключения VB6 программ в мире округления.
#upd(9.06.2022 - 6:56 PM):
Чё за хуйня?
#upd(9.06.2022 - 6:59 PM):
Нашлось в справке по VB5.
When the fractional part is exactly 0.5, CInt and CLng always round it to the nearest even number. For example, 0.5 rounds to 0, and 1.5 rounds to 2. CInt and CLng differ from the Fix and Int functions, which truncate, rather than round, the fractional part of a number. Also, Fix and Int always return a value of the same type as is passed in.
Это не про Round(), но всё же.
Both Int and Fix remove the fractional part of number and return the resulting integer value.
The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
Звучит как что-то из далёкого прошлого OO Уже сто лет не пользовалась этими функциями...
#upd(9.06.2022 - 7:42 PM):
Округление до ближайшего чётного (в английском языке известно под названием англ. banker's rounding — «округление банкира») — округление для этого случая происходит к ближайшему чётному числу, то есть 2,5 – 2; 3,5 – 4.
https://ru.wikipedia.org/wiki/Округление
Пишут, что Round() именно так и работает. Вот засада!
#upd(9.06.2022 - 8:49 PM):
Придётся пилить ручками человеческое округление. А мне всего-то нужен был аналог Ceil(), который я пилила как «Round(X + 0.5)», но не сразу поняла, что оно как-то странно работает.
Вот таких программастов нужно кастрировать или стерилизовать (в зависимости от пола). Размножаться подобные не должны
Тут только один вопрос могу вспомнить: "Нахуя, а главное - зачем?"
what the fuck is this shit? OO