You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/arguments.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,19 +78,27 @@ llo
78
78
ld!
79
79
```
80
80
81
-
Functor **to_number(*string*)** transforms a string representing a number to its associated number, it also recognises hex and binary numbers with a prefix.
81
+
Functor **to_number(*string*)** transforms a string representing a number to its associated number.
82
82
```prolog
83
83
.decl tonumber(n:number)
84
84
.output tonumber
85
85
tonumber(n) :- n=to_number("123").
86
86
tonumber(n) :- n=to_number("1534").
87
-
tonumber(n) :- n=to_number("0xff").
88
-
tonumber(n) :- n=to_number("0b111").
89
87
```
90
88
The output would be:
91
89
```
92
90
123
93
91
1534
92
+
```
93
+
In souffle `>=2.5`, functor **to_number(*string*)** also recognises hex and binary strings with a prefix.
0 commit comments