Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context wrapper for calculations with term objects #27

Open
wilsonfreitas opened this issue Jul 18, 2022 · 0 comments
Open

Context wrapper for calculations with term objects #27

wilsonfreitas opened this issue Jul 18, 2022 · 0 comments

Comments

@wilsonfreitas
Copy link
Owner

I have a problem with term objects.

I can't do comparison between term objects because I don't know how to count them (I don't have a daycount).

I can't say that 252 days == 1 year is true, for example, if the daycout is business/252 this is true, otherwise this is not.

The same happens with arithmetic operations, 1 month + 12 days, without a daycount this operation can't be done.

With a context wrapper, that defines the daycount, these expression should be evaluated properly.

t1 <- term(252, "days")
t2 <- term(1, "year")
with_daycount("business/252", t1 == t2)
with_daycount("actual/360", t1 == t2)

These operations are evaluated with the given daycount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant