From fdf6927585a67a3647265f44ff2a91749e253c88 Mon Sep 17 00:00:00 2001 From: 3RM1N3 <47353218+3RM1N3@users.noreply.github.com> Date: Fri, 25 Dec 2020 09:19:00 -0600 Subject: [PATCH] docs: fix the century algorithm example in docs.md (#7549) --- doc/docs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/docs.md b/doc/docs.md index 5c05dc3569..c89ab330e5 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -747,11 +747,12 @@ However, you _can_ redeclare a type. ```v import time +import math type MyTime = time.Time fn (mut t MyTime) century() int { - return 1 + t.year % 100 + return int(1.0 + math.trunc(f64(t.year) * 0.009999794661191)) } fn main() {