[Jprogramming] Numerator and Denominator
Roger Hui
rogerhui.canada at gmail.com
Wed Mar 9 15:26:12 UTC 2016
den and num illustrate different ways of computing the same thing,
hopefully in so doing improves understanding. If you want speed 2&x: is
going to be faster.
Also, watch this:
2 x: o. 1
1285290289249 409120605684
x: o. 1
1285290289249r409120605684
2 x:!.0 o. 1
884279719003555 281474976710656
x:!.0 o. 1
884279719003555r281474976710656
On Wed, Mar 9, 2016 at 7:20 AM, Mike Day <mike_liz.day at tiscali.co.uk> wrote:
> Roger, are these (among) recommended and preferred methods for
> recovering num & den, or do they just show an elegant way of
> avoiding 2 x: ?
>
> Thanks,
>
> Mike
>
>
> On 09/03/2016 04:32, Roger Hui wrote:
>
>> x=: %/?2$10^8x
>> x
>> 69904549r40669028
>>
>> den=: [: % 1 +. ]
>> num=: * den
>>
>> den x
>> 40669028
>> num x
>> 69904549
>>
>>
>>
>>
>> On Tue, Mar 8, 2016 at 7:28 PM, Kip Murray <thekipmurray at gmail.com>
>> wrote:
>>
>> That's great! It's still a nice puzzle to write your own. --Kip
>>>
>>> On Tuesday, March 8, 2016, Raul Miller <rauldmiller at gmail.com> wrote:
>>>
>>> 2 x: 6r4
>>>> 3 2
>>>>
>>>> --
>>>> Raul
>>>>
>>>>
>>>> On Tue, Mar 8, 2016 at 10:04 PM, Kip Murray <thekipmurray at gmail.com
>>>> <javascript:;>> wrote:
>>>>
>>>>> How do you find the numerator and denominator in lowest terms of a
>>>>>
>>>> rational
>>>>
>>>>> fraction? For example,
>>>>>
>>>>> nd 6r4
>>>>> 3 2
>>>>>
>>>>> --Kip Murray
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from Gmail Mobile
>>>>> ----------------------------------------------------------------------
>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>>
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>
>>>
>>>
>>> --
>>> Sent from Gmail Mobile
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list