Arduino ile 2^128 hesaplayan yazılımı ChatGPT ile beraber yazdık

// Define the number of digits required to store the result
#define NUM_DIGITS 40

void setup() {
  Serial.begin(9600);
  
  // Define the array to store the result
  int result[NUM_DIGITS] = {0};

  // Set the first digit to 1
  result[0] = 1;

  // Calculate 2^128 iteratively
  for (int i = 0; i < 128; i++) {
    int carry = 0;

    // Multiply each digit of the result by 2 and add the carry from the previous digit
    for (int j = 0; j = 0; i--) {
    Serial.print(result[i]);
  }
}

void loop() {
  // Nothing to do here
}

Wowki

https://wokwi.com/projects/361996755593355265

ChatGPT ile olan diyaloğumuz altaki resimde görülüyor

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.