Sending this message on behalf of Paul Newton who has asked me to relay it to the group as he is having problems sending emails to Profox.
He asks the following:
Hi all
I need to calculate N % 97 aka Mod(N,97) for very large numbers containing 28 digits. Obviously VFP can't handle numbers that large but maybe somebody can suggest some kind of piece-wise method that would enable me to calculate what I need?
Is there a library out there for VFP which would facilitate arbitrary-precision arithmetic?
Many thanks
Paul Newton
Thanks in advance Dave
Paul
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
Paul, This may lead somewhere...
http://fox.wikis.com/wc.dll?Wiki~VFPFloatingPointDataType
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox profox-bounces@leafe.com On Behalf Of Dave Crozier Sent: 16 April 2018 15:14 To: ProFox Email List profox@leafe.com Subject: Modulo 97 of a very large number
Sending this message on behalf of Paul Newton who has asked me to relay it to the group as he is having problems sending emails to Profox.
He asks the following:
Hi all
I need to calculate N % 97 aka Mod(N,97) for very large numbers containing 28 digits. Obviously VFP can't handle numbers that large but maybe somebody can suggest some kind of piece-wise method that would enable me to calculate what I need?
Is there a library out there for VFP which would facilitate arbitrary-precision arithmetic?
Many thanks
Paul Newton
Thanks in advance Dave
Paul
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/18725B8CD2D5D247873A2BAF401D4AB2BEC6D... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Thanks Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Dave Crozier Sent: 16 April 2018 15:16 To: ProFox Email List profox@leafe.com Subject: RE: Modulo 97 of a very large number
Paul, This may lead somewhere...
http://fox.wikis.com/wc.dll?Wiki~VFPFloatingPointDataType
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox profox-bounces@leafe.com On Behalf Of Dave Crozier Sent: 16 April 2018 15:14 To: ProFox Email List profox@leafe.com Subject: Modulo 97 of a very large number
Sending this message on behalf of Paul Newton who has asked me to relay it to the group as he is having problems sending emails to Profox.
He asks the following:
Hi all
I need to calculate N % 97 aka Mod(N,97) for very large numbers containing 28 digits. Obviously VFP can't handle numbers that large but maybe somebody can suggest some kind of piece-wise method that would enable me to calculate what I need?
Is there a library out there for VFP which would facilitate arbitrary-precision arithmetic?
Many thanks
Paul Newton
Thanks in advance Dave
Paul
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
[excessive quoting removed by server]
I need to calculate N % 97 aka Mod(N,97) for very large numbers containing 28 digits. Obviously VFP can't handle numbers that large but maybe somebody can suggest some kind of piece-wise method that would enable me to calculate what I need?
Sounds like an IBAN checksum calculation.
Procedure IBAN (tcCountry, tcBBAN) Local lnChk, lcIBAN lnChk = 98 - This.CheckSum (m.tcCountry+"00"+m.tcBBAN) lcIBAN = m.tcCountry + Padl( Alltrim (Str(m.lnChk)), 2, "0") + m.tcBBAN Return m.lcIBAN
Procedure Checksum (tcIBAN)
Local lcBBAN, lcLK1, lcLK2, lcDigits lcBBAN = Substr (m.tcIBAN, 5, 18) lcLK1 = TRANSFORM (ASC (Left (m.tcIBAN,1))-55,"@L 99") lcLK2 = TRANSFORM (ASC (SUBSTR (m.tcIBAN,2,1))-55,"@L 99") lcDigits = m.lcBBAN + m.lcLK1 + m.lcLK2 + Substr(m.tcIBAN,3,2)
Local lnMod, lnPos, lnDigit lnMod = 0 For lnPos = 1 to Len(m.lcDigits) lnDigit = Val (Substr (m.lcDigits, m.lnPos, 1)) lnMod = ((m.lnMod * 10) + m.lnDigit) % 97 EndFor
Return m.lnMod
If you by chance need to generate German SEPA XML files, we have a VFP solution for that. It should be adoptable for other countries with minor changes.
Brilliant Christof
Many thanks
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Wollenhaupt, Christof Sent: 16 April 2018 15:36 To: profoxtech@leafe.com Subject: Re: Modulo 97 of a very large number
I need to calculate N % 97 aka Mod(N,97) for very large numbers containing 28 digits. Obviously VFP can't handle numbers that large but maybe somebody can suggest some kind of piece-wise method that would enable me to calculate what I need?
Sounds like an IBAN checksum calculation.
Procedure IBAN (tcCountry, tcBBAN) Local lnChk, lcIBAN lnChk = 98 - This.CheckSum (m.tcCountry+"00"+m.tcBBAN) lcIBAN = m.tcCountry + Padl( Alltrim (Str(m.lnChk)), 2, "0") + m.tcBBAN Return m.lcIBAN
Procedure Checksum (tcIBAN)
Local lcBBAN, lcLK1, lcLK2, lcDigits lcBBAN = Substr (m.tcIBAN, 5, 18) lcLK1 = TRANSFORM (ASC (Left (m.tcIBAN,1))-55,"@L 99") lcLK2 = TRANSFORM (ASC (SUBSTR (m.tcIBAN,2,1))-55,"@L 99") lcDigits = m.lcBBAN + m.lcLK1 + m.lcLK2 + Substr(m.tcIBAN,3,2)
Local lnMod, lnPos, lnDigit lnMod = 0 For lnPos = 1 to Len(m.lcDigits) lnDigit = Val (Substr (m.lcDigits, m.lnPos, 1)) lnMod = ((m.lnMod * 10) + m.lnDigit) % 97 EndFor
Return m.lnMod
If you by chance need to generate German SEPA XML files, we have a VFP solution for that. It should be adoptable for other countries with minor changes.
-- Christof
<div dir='auto'>How about store orig # as char str - then take chunks starting from left - do Mod of them but results stored as multiple of 10 based upon orig str pos - then I think U can add those sub results together. Just a quick thought off top of my head...<div dir="auto"><br></div><div dir="auto">-K-</div></div>
<div dir='auto'>Darn - I replied on my Cell & didn't C all the replies already there!<div dir="auto"><br></div><div dir="auto">:-(</div><div dir="auto">-K-</div><div dir="auto"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 16, 2018 11:48 AM, Kurt Wendt <vrfx@optonline.net> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">How about store orig # as char str - then take chunks starting from left - do Mod of them but results stored as multiple of 10 based upon orig str pos - then I think U can add those sub results together. Just a quick thought off top of my head...<div dir="auto"><br /></div><div dir="auto">-K-</div></div></blockquote></div><br></div>JÚâ€ÈŠy©¢»i®²Ç0¥ªí²×±·ømXmVèw'(÷«µç
+1
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Kurt Wendt Sent: 16 April 2018 16:51 To: profoxtech@leafe.com Subject: Re: Modulo 97 of a very large number
PGRpdiBkaXI9J2F1dG8nPkRhcm4gLSBJIHJlcGxpZWQgb24gbXkgQ2VsbCAmY W1wOyBkaWRuJ3Qg QyBhbGwgdGhlIHJlcGxpZXMgYWxyZWFkeSB0aGVyZSE8ZGl2IGRpcj0iYXV0by I+PGJyPjwvZGl2 PjxkaXYgZGlyPSJhdXRvIj46LSg8L2Rpdj48ZGl2IGRpcj0iYXV0byI+LUstPC9kaXY+ PGRpdiBk aXI9ImF1dG8iPjxicj48L2Rpdj48L2Rpdj48ZGl2IGNsYXNzPSJnbWFpbF9leHRyYSI +PGJyPjxk aXYgY2xhc3M9ImdtYWlsX3F1b3RlIj5PbiBBcHIgMTYsIDIwMTggMTE6NDggQU0 sIEt1cnQgV2Vu ZHQgJmx0O3ZyZnhAb3B0b25saW5lLm5ldCZndDsgd3JvdGU6PGJyIHR5cGU9I mF0dHJpYnV0aW9u Ij48YmxvY2txdW90ZSBjbGFzcz0icXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDA gLjhleDtib3Jk ZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij48ZGl2I GRpcj0iYXV0byI+ SG93IGFib3V0IHN0b3JlIG9yaWcgIyBhcyBjaGFyIHN0ciAtIHRoZW4gdGFrZSBja HVua3Mgc3Rh cnRpbmcgZnJvbSBsZWZ0IC0gZG8gTW9kIG9mIHRoZW0gYnV0IHJlc3VsdHMgc3 RvcmVkIGFzIG11 bHRpcGxlIG9mIDEwIGJhc2VkIHVwb24gb3JpZyBzdHIgcG9zIC0gdGhlbiBJIHRoa W5rIFUgY2Fu IGFkZCB0aG9zZSBzdWIgcmVzdWx0cyB0b2dldGhlci4gSnVzdCBhIHF1aWNrIHR ob3VnaHQgb2Zm wqAgdG9wIG9mIG15IGhlYWQuLi48ZGl2IGRpcj0iYXV0byI+PGJyIC8+PC9kaXY+ PGRpdiBkaXI9 ImF1dG8iPi1LLTwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9ka XY+
--- StripMime Report -- processed MIME parts --- text/html (html body -- converted)
[excessive quoting removed by server]
Ha ha - Very funny John! Its VERY Odd - sometimes my replies on my Cell produce Garbage here! Even my prior reply to this thread - which DID get a reasonably normal posting - still had weird formatting issues.
Anyway - my original reply - I felt it might have been a bit of a creative solution. But, alas - others posted with much more viable methods to solve the problem...
-K-
On 4/16/2018 2:16 PM, John Weller wrote:
+1
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Kurt Wendt Sent: 16 April 2018 16:51 To: profoxtech@leafe.com Subject: Re: Modulo 97 of a very large number
PGRpdiBkaXI9J2F1dG8nPkRhcm4gLSBJIHJlcGxpZWQgb24gbXkgQ2VsbCAmY W1wOyBkaWRuJ3Qg QyBhbGwgdGhlIHJlcGxpZXMgYWxyZWFkeSB0aGVyZSE8ZGl2IGRpcj0iYXV0by I+PGJyPjwvZGl2 PjxkaXYgZGlyPSJhdXRvIj46LSg8L2Rpdj48ZGl2IGRpcj0iYXV0byI+LUstPC9kaXY+ PGRpdiBk aXI9ImF1dG8iPjxicj48L2Rpdj48L2Rpdj48ZGl2IGNsYXNzPSJnbWFpbF9leHRyYSI +PGJyPjxk aXYgY2xhc3M9ImdtYWlsX3F1b3RlIj5PbiBBcHIgMTYsIDIwMTggMTE6NDggQU0 sIEt1cnQgV2Vu ZHQgJmx0O3ZyZnhAb3B0b25saW5lLm5ldCZndDsgd3JvdGU6PGJyIHR5cGU9I mF0dHJpYnV0aW9u Ij48YmxvY2txdW90ZSBjbGFzcz0icXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDA gLjhleDtib3Jk ZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij48ZGl2I GRpcj0iYXV0byI+ SG93IGFib3V0IHN0b3JlIG9yaWcgIyBhcyBjaGFyIHN0ciAtIHRoZW4gdGFrZSBja HVua3Mgc3Rh cnRpbmcgZnJvbSBsZWZ0IC0gZG8gTW9kIG9mIHRoZW0gYnV0IHJlc3VsdHMgc3 RvcmVkIGFzIG11 bHRpcGxlIG9mIDEwIGJhc2VkIHVwb24gb3JpZyBzdHIgcG9zIC0gdGhlbiBJIHRoa W5rIFUgY2Fu IGFkZCB0aG9zZSBzdWIgcmVzdWx0cyB0b2dldGhlci4gSnVzdCBhIHF1aWNrIHR ob3VnaHQgb2Zm wqAgdG9wIG9mIG15IGhlYWQuLi48ZGl2IGRpcj0iYXV0byI+PGJyIC8+PC9kaXY+ PGRpdiBkaXI9 ImF1dG8iPi1LLTwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9ka XY+
--- StripMime Report -- processed MIME parts --- text/html (html body -- converted)
[excessive quoting removed by server]