Round in functions

Round in functions - 消息

#1 已发布: 2009/9/14 23:07:54
Greg Locock

Greg Locock

0个赞,共53个帖子。

组: User

I'm trying to use round(x,0) in a function to fix a floating point number, so that I can use it as an index in a matrix.

However, when I try to do this it doesn't work, and the yellow box shows that all instances of round have been reinterpreted as mod.


#2 已发布: 2009/9/14 23:20:18
Andrey Ivashov

Andrey Ivashov

2,344个赞,共4,057个帖子。

组: Super Administrator


Seems it's OK. Need an example.
#3 已发布: 2009/9/14 23:32:45
Greg Locock

Greg Locock

0个赞,共53个帖子。

组: User

dn(day,month,year)←round((0+({month-1}/12)+year-1900)*365.25+day,0)
dn(15,9,2009)=


#4 已发布: 2009/9/14 23:41:00
Andrey Ivashov

Andrey Ivashov

2,344个赞,共4,057个帖子。

组: Super Administrator

My fault, sorry.
Error fixed.
[MATH lang=eng]dn(day,month,year)←round((0+({month-1}/12)+year-1900)*365.25+day,0)[/MATH]
[MATH lang=eng]dn(15,9,2009)=40071[/MATH]

What version you need to have (Desktop/Linux/Handheld)? If you need in Desktop one, then here is new builds for you:
SMathStudioDesktop.0_85_3545.Setup.msi
SMathStudioDesktop.0_85_3545.Portable.exe
#5 已发布: 2009/9/15 00:00:17
Greg Locock

Greg Locock

0个赞,共53个帖子。

组: User


  • 有新帖
  • 无新帖