Base-16 representation: Difference between revisions
Content deleted Content added
Add Factor |
→{{header|Factor}}: tweak non-decimal? again |
||
Line 61: | Line 61: | ||
{{works with|Factor|0.99 2021-02-05}} |
{{works with|Factor|0.99 2021-02-05}} |
||
<lang factor>USING: combinators |
<lang factor>USING: combinators formatting grouping io kernel lists |
||
lists.lazy math prettyprint sequences ; |
|||
! Returns t if the hexadecimal representation of n contains a |
! Returns t if the hexadecimal representation of n contains a |
||
! non-decimal digit. |
! non-decimal digit. |
||
: non-decimal? ( n -- ? ) |
: non-decimal? ( n -- ? ) |
||
{ |
|||
⚫ | |||
{ [ dup zero? ] [ drop f ] } |
|||
⚫ | |||
[ -4 shift non-decimal? ] |
|||
} cond ; |
|||
1 lfrom [ non-decimal? ] lfilter [ 501 < ] lwhile |
1 lfrom [ non-decimal? ] lfilter [ 501 < ] lwhile |